Hey! i solve it. Thanks for that reminder!

Tired before. Same error

[CODE]$dbConn = mysqli_connect(DBSERVER, DBUSER, DBPASS, DBNAME) or die(mysqli_connect_error());
$sql = "select * from hairstyle";
$result = mysqli_query($dbConn, $sql) or die(mysqli_error($dbConn));
$row = mysql_fetch_array($result);
echo '';
$i = 0;
while ($row)
{
if ($i % 5 == 0)
echo '';

echo "<img src = 'hairstyle/" . $row['hair_img'] . "' width = '200' alt = 'images'>";
if ($i % 5 == 4)
echo '';

$i++;
}

if ($i % 5 > 0)
{
$i = 5 - ($i % 5);
echo " ";
}
echo '';[/CODE]

Here is my code.

yes. i did

Hi priteas, i would like to thank you first. But however i referred to your codes on the other thread and got this error.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\IISRoot\RP\84557\sally1\viewHairstyle.php on line 8

Hi, i didnt get the expected result.. Is my code wrong?
[CODE]$dbConn = mysqli_connect(DBSERVER, DBUSER, DBPASS, DBNAME) or die(mysqli_connect_error());
$sql = "select * from hairstyle";
$result = mysqli_query($dbConn, $sql) or die(mysqli_error($dbConn));

echo "";
$counter = 0;
while($row = mysqli_fetch_array($result)){
if ($counter != 4){
echo "

"; $counter ++; } echo ""; } echo "";[/CODE]
lf.gene Junior Poster in Training

Hi all, i wonder is it possible to display my images from database into table with 4 rows and 4 column? How can i do that?

[CODE]

$dbConn = mysqli_connect(DBSERVER, DBUSER, DBPASS, DBNAME) or die(mysqli_connect_error());
$sql = "select * from products";
$result = mysqli_query($dbConn, $sql) or die(mysqli_error($dbConn));

echo "";

       while($row = mysqli_fetch_array($result)){
        echo "<tr>
                 <td><img src = 'images/" . $row['img'] . "' width = '200' alt = 'images'></td>
        </tr>";

}
echo "";
[/CODE]

lf.gene Junior Poster in Training

[ICODE]

PicNet Table Filter Demo $(document).ready(function() { // Randomly Create Data Rows for (var i = 0; i 0.5 ? "yes" : "no") + "" + "" + (Math.random() 0.5 ? "Item 2" : "Item 3") + "" + "" + "" + parseInt(10 + Math.random() * 18) + "/" + parseInt(10 + Math.random() * 2) + "/2009" + "" + ""); $('#demotable1 tbody').append(tr); } for (var i = 0; i

Alright, i'll take note of it. Thanks.

I've another question. Is it possible to store values into array whereby i dont use any for loop?

[CODE]
while ($data = mysql_fetch_array($scheduleResult))
{

    $day[$j] = $data['od_week'];

}

[/CODE]

lf.gene Junior Poster in Training

Hi all,
how do i compare one date with a list of array which consist of date?

[ICODE]
$date = 1990-12-3

$viewSchedule = "select * from schedule where id_user = '$idHairstlylist'";
$scheduleResult = mysqli_query($dbConn,$viewSchedule) or die(mysqli_error($dbConn));

while ($row1 = mysqli_fetch_array($scheduleResult)){
for($j=1;$j<=4;$j++){
$day[$j] = $row1['od_week'.$j];

         if ($day[$j]!= $date){
           echo 'hi';
            }
        }

[/ICODE]

issit possible?

alright. I'm using jquery by the way. So here the code.

viewReservation.php
[CODE]<?php
include('header.php');
?>

Book appointment
   <?php
        $idUser = $_GET['id'];

       /* $dbConn = mysqli_connect(DBSERVER,DBUSER,DBPASS,DBNAME) or die(mysqli_connect_error());
        $viewquery = "";
        $viewResult = mysqli_query($dbConn,$viewquery) or die(mysqli_error($dbConn));*/
     ?>

        <Form name ="form" method ="post" action = "bookReservation.php" >
        <p>Choose Date: <input type="text" name ="date" id="datepicker">
           Choose Time Slot:<select name ="time" id ="select">
           <option>--</option>
           <option>11:00:00-12:00:00</option>
           <option>13:00:00-14:00:00</option>
           <option>15:00:00-16:00:00</option>
           <option>19:00:00-20:00:00</option>
           </select>
           <input type ="hidden" name ="id" value =<?php "$idUser"?>>
           <input type ="submit" value ="Book!">
        </p>
        </form>

<?php
include('end.php');
?>[/CODE]

header.php
[CODE]
<?php
include "dbconfig.inc.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Sally Hairstyling // increase the default animation speed to exaggerate the effect $.fx.speeds._default = 1000; //tabs $(function(){ $( "#tabs" ).tabs(); //button $( "button, input:submit, a", ".demo" ).button(); $( "a", ".demo" ).click(function() { return false; }); //dialog $( "#dialog" ).dialog({ autoOpen: false, show: "blind", hide: "explode" }); $( "#opener" ).click(function() { $( "#dialog" ).dialog( "open" ); return false; }); // Datepicker $('#datepicker') .datepicker({ inline: true, createButton:false, displayClose:true, closeOnSelect:false, selectMultiple:true, numSelectable:3 }) .bind( 'dateSelected', function(e, selectedDate, $td, state) { console.log('You ' + (state ? '' : 'un') // wrap + 'selected ' + selectedDate); } ) .bind( 'dpClosed', function(e, selectedDates) { console.log('You closed the date picker and the ' // wrap + 'currently selected dates are:'); console.log(selectedDates); } ) ; }); ...

The date format is in MM-DD-YY, but i need the format to be YY-MM-DD.

I solved the problem already. But i have another problem about the date format from the calendar.

[CODE]$(function(){
$('#datepicker')
.datepicker({
inline: true,
createButton:false,
displayClose:true,
closeOnSelect:false,
selectMultiple:true,
numSelectable:3

                })
                .bind(
                    'dateSelected',
                    function(e, selectedDate, $td, state)
                    {
                        console.log('You ' + (state ? '' : 'un') // wrap
                            + 'selected ' + selectedDate);

                    }
                )
                .bind(
                    'dpClosed',
                    function(e, selectedDates)
                    {
                        console.log('You closed the date picker and the ' // wrap
                            + 'currently selected dates are:');
                        console.log(selectedDates);
                    }
                )
                ;});[/CODE]
lf.gene Junior Poster in Training

Hi all, by using form and post method in my program. It seems like my values of calendar are not able to insert into my database. I'm using jquery's datepicker and php to code. Please advice. Thanks

Thanks for your help..however it dont seem to be working. The is unable to call out the theme and calendar i want.

Ok, i understood. But however, i need both different function from different jquery. Is there any way that i can make use both of the jquery?

This is my code, however im unable to select multiple date that are up to 3
[CODE]$(function(){$('#datepicker')
.datepicker({
inline: true,
createButton:false,
displayClose:true,
closeOnSelect:false,
selectMultiple:true,
numSelectable:3
});
});[/CODE]

lf.gene Junior Poster in Training

Hi. I have question regarding jquery. I would like to know is it possible to put two href into one therefore i can use two different css for one jquery?

[CODE]

    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.6.custom.min.js"></script>     
[/CODE]
lf.gene Junior Poster in Training

Hi all,

Im currently working on a project that requires me to use jquery that i have never learnt before. I have downloaded the library online. How can i change the datepicker calendar to able to select multiple date at one time?

your code is not working

lf.gene Junior Poster in Training

Hi! i have problems one query.

$day_result has a value of 1 and 4

$sql3 = "Select * from Venue where idVenue != $day_result";
echo $sql3;
if i use for loop for the above it will give the result below

Select from Venue where idVenue != 1
Select
from Venue where idVenue != 4

But this is the result i want to get:

Select * from Venue where idVenue != 1 and idVenue != 4

wad loop or is there anyway to append? how can i do it?

lf.gene Junior Poster in Training

Hi! i have problems one query.

$day_result has a value of 1 and 4

$sql3 = "Select * from Venue where idVenue != $day_result";
echo $sql3;
if i use for loop for the above it will give the result below

Select from Venue where idVenue != 1
Select
from Venue where idVenue != 4

But this is the result i want to get:

Select * from Venue where idVenue != 1 and idVenue != 4

how can i do it?

Anyone can help? this is urgent to me!

The code above is help me to filter the data, the whole code for the page is very lengthy, therefore i only paste out the code with the problem.

Oh. I have a set of data. Require filtering. I need to select data from venue which are not used for any days and time.

lf.gene Junior Poster in Training

Hi, i have problem regarding my code. I using alot of for loop and while loop. However, its been to be one of the while loop is hindering the first loop.

Here my code.

[CODE]Do{
//assigned day 1-9
for ($i=1; $i<=9; $i++){

                    echo '<option>Hi</option>';
                        if($assigned_venue['day0'.$i] != ''){

                        $assigned_date[$i] = $assigned_venue['day0'.$i];
                        //store assigned venue
                        $venue_assigned[$i] = $assigned_venue['Venue_idVenue'];

                        echo 'TESTA:'.$assigned_date[$i];
                        //echo '<br>';
                        //echo '<option>'.$venue_assigned[$i].'</option>';
                        //echo '<br>';

                            //assigning day 1-9 
                            for ($k=1; $k<=9; $k++){
                                if($assigning_venue['day0'.$k] != '')
                            {
                                $assigning_date[$k] = $assigning_venue['day0'.$k];
                                //echo 'TESTC:'.$assigning_date[$k];
                            }

                                if ($assigned_date[$i] == $assigning_date[$k]){
                                //echo 'Hello!';

                                do {
                                    $day_result = $assigned_day_array['Venue_idVenue'];
                                    echo $day_result;
                                    }
                                while($assigned_day_array = mysqli_fetch_array($assigned_day_result));

                                //Check day duration
                                for($l=1;$l<=$assigned_day_row;$l++){       

                                        if (($day_result) != ($venue_assigned[$i]))

                                        {
                                        echo 'DEBUGA:'.$day_result.'<br>';
                                            //echo 'HEllo1';
                                            //echo '<option>'.$day_result.'</option>';
                                            //echo $venue_assigned[$i];
                                            /*$sql3 = "Select * from Venue where ";

                                            for($g=1;$g<=$assigned_day_row;$g++){
                                            $sql3 = $sql3." idVenue != $day_result ";
                                            $sql3 = $sql3." and";
                                            }

                                            //echo '<option>'.$sql3.'</option>';
                                            $result3 = mysqli_query($link,$sql3) or die(mysqli_error($link));
                                            $row3 = mysqli_fetch_array($result3);
                                            //echo 'TEST1'.$row3['name'];
                                            //echo' <option name="venue">'.$row3['name'].'</option>';*/

                                        }
                                        else  
                                        {
                                            //Check Night Duration
                                            for($m=1;$m<=$assigned_night_row;$m++){
                                            $night_result[$m] = $assigned_night_array['Venue_idVenue'.$m];

                                                if ($night_result[$m]!= $venue_assigned[$i])
                                                {
                                                    $venue_used[$m] = $assigned_night_array['idVenue'.$m];
                                                    //$sql4 = "Select * from Venue where idVenue != $venue_used[$m]";
                                                    $result4 = mysqli_query($link,$sql4) or die(mysqli_error($link));
                                                    $row4 = mysqli_fetch_array($result4);
                                                    //echo 'TEST2'.$row4['name'];
                                                    //echo' <option name="venue">'.$row4['name'].'</option>';
                                                }
                                                else
                                                    //else display the remainding venue
                                                    {
                                                        $sql5 = "Select * from venue";
                                                        $result5 = mysqli_query($link,$sql5) or die(mysqli_error($link));
                                                        $row5 = mysqli_fetch_array($result5);
                                                        //echo 'Test3'.$row5['name'];
                                                        //echo' <option name="venue">'.$row5['name'].'</option>';
                                                    }
                                                }
                                        }

                                    }

                                }

                            }   
                        }
                    }[/CODE]

The do while loop in line 30 seems to hinder the main do while loop.
expected result for $day_result is 1 and 4.
If ...

lf.gene Junior Poster in Training

Hi! is it possible to put a do while loop in a do while loop?

For eg:

DO{

CODES
DO{
}
while
}
while

lf.gene Junior Poster in Training

Hi all, I've errors in my code and i'm unsure whether the way i loop is in a correct method. Pls give me some guidance as it is very important to me. Thank!

Error i got-> Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\FYP\assign_venueTest.php on line 118

[CODE]<?php
$class_id = $_GET['id'];
$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'sjas';
$link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB);

//get class
$sql1 = "SELECT * FROM class,course WHERE idClass = $class_id and Course_idCourse = idCourse";
$result1 = mysqli_query($link,$sql1) or die(mysqli_error($link));
$row1 = mysqli_fetch_array($result1);

//get students
$sql2 = "SELECT * FROM member m,attendance a WHERE Class_idClass = $class_id and Member_idMember = idMember group by idMember";
$result2 = mysqli_query($link,$sql2) or die(mysqli_error($link));
$no_student = mysqli_num_rows($result2);
$student_name = mysqli_fetch_array($result2);

//Get information of assigning class
$assigning = "Select Class_idCLass,Venue_idVenue,day01,day02,day03,day04,day05,day06,day07,day08,day09,day10,day11,day12 from attendance, class where Venue_idVenue IS NULL and Class_idClass = $class_id group by Class_idClass";
$assigning_result = mysqli_query($link,$assigning) or die(mysqli_error($link));
$assigning_no = mysqli_num_rows($assigning_result);
$assigning_venue = mysqli_fetch_array($assigning_result);

//For Assigning Day duration
$assigning_day = "Select Class_idCLass,Venue_idVenue,idVenue, idTime_Slot from attendance, class, time_slot, venue where Venue_idVenue IS NULL and Class_idClass = $class_id and idTime_Slot = 1 group by Class_idClass";
$assigning_day_result = mysqli_query($link,$assigning_day) or die(mysqli_error($link));
$assigning_day_no = mysqli_num_rows($assigning_day_result);
$assigning_venue = mysqli_fetch_array($assigning_day_result);

//For Assigning Night duration
$assigning_night = "Select Class_idCLass,Venue_idVenue,idVenue, idTime_Slot from attendance, class, time_slot, venue where Venue_idVenue IS NULL and Class_idClass = $class_id and idTime_Slot = 2 group by Class_idClass";
$assigning_night_result = mysqli_query($link,$assigning_night) or die(mysqli_error($link));
$assigning_night_no = mysqli_num_rows($assigning_night_result);
$assigning_venue = mysqli_fetch_array($assigning_night_result);

//Get Assigned Venue's information
$assigned = "Select Class_idCLass,Venue_idVenue,day01,day02,day03,day04,day05,day06,day07,day08,day09,day10,day11,day12 from attendance a,class ...

Thanks! I got no errors now.. But can i ask.. is the way i use loop is incorrect method? how come i getting too much repeating of answer? that causes this error:Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\FYP\assign_venueTest.php on line 82

lf.gene Junior Poster in Training

Hi all, I having this error "Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\FYP\assign_venueTest.php on line 104" in my code. I cant find where does my code went wrong. Need you guys to help me out.

[CODE]
<?php
$class_id = $_GET['id'];
$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'sjas';
$link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB);

//get class
$sql1 = "SELECT * FROM class,course WHERE idClass = $class_id and Course_idCourse = idCourse";
$result1 = mysqli_query($link,$sql1) or die(mysqli_error($link));
$row1 = mysqli_fetch_array($result1);

//get students
$sql2 = "SELECT * FROM member m,attendance a WHERE Class_idClass = $class_id and Member_idMember = idMember group by idMember";
$result2 = mysqli_query($link,$sql2) or die(mysqli_error($link));
$no_student = mysqli_num_rows($result2);
$student_name = mysqli_fetch_array($result2);

//Get information of assigning class
$assigning = "Select Class_idCLass,Venue_idVenue,day01,day02,day03,day04,day05,day06,day07,day08,day09,day10,day11,day12 from attendance, class where Venue_idVenue IS NULL and Class_idClass = $class_id group by Class_idClass";
$assigning_result = mysqli_query($link,$assigning) or die(mysqli_error($link));
$assigning_no = mysqli_num_rows($assigning_result);
$assigning_venue = mysqli_fetch_array($assigning_result);

//For Assigning Day duration
$assigning_day = "Select Class_idCLass,Venue_idVenue,idVenue, idTime_Slot from attendance, class, time_slot, venue where Venue_idVenue IS NULL and Class_idClass = $class_id and idTime_Slot = 1 group by Class_idClass";
$assigning_day_result = mysqli_query($link,$assigning_day) or die(mysqli_error($link));
$assigning_no = mysqli_num_rows($assigning_day_result);
$assigning_venue = mysqli_fetch_array($assigning__day_result);

//For Assigning Night duration
$assigning_night = "Select Class_idCLass,Venue_idVenue,idVenue, idTime_Slot from attendance, class, time_slot, venue where Venue_idVenue IS NULL and Class_idClass = $class_id and idTime_Slot = 2 group by Class_idClass";
$assigning_night_result = mysqli_query($link,$assigning_night) or die(mysqli_error($link));
$assigning_no = mysqli_num_rows($assigning_night_result);
$assigning_venue = mysqli_fetch_array($assigning_night_result);

//Get Assigned Venue's information
$assigned = "Select Class_idCLass,Venue_idVenue,day01,day02,day03,day04,day05,day06,day07,day08,day09,day10,day11,day12 from attendance a,class c where a.Class_idClass is not Null and a.Venue_idVenue is not Null Group by ...