Hello there. Sorry that I don't really know much about drop down button in php. I was assign to do a booking system as my final project but somehow I don't know how to make the button works. It suppost to be like this. The user needs to choose which school he is going to book the locker. And after he has choosen, the numbers of lockers will be listed down and he can choose which one that he wants. But the problem here is, the value from drop down button seems like it can't pass the value from the database. Here is the codes :
okay thanks! I got it. :D but the first data didn't appear. What I mean is, okay it's like this. The data in the database for option 1 that is SMK Seri Pantai, there are 10 data. but it only display 9 data. Do you think there is something missing in the code? =/
dean8710: sorry but I don't get what does require_once("../includes/config.php");and require_once("../includes/dbconnect.php"); does. before what I learn is really basic. What is requires inside this includes?
I notice your fetching twice $myrow=mysql_fetch_row($result); as you begin displaying rows
from line 11,13,39
from ther first fetch you got the first row but the second fetch is on the if condition as the second fetch goes it fetches the second row then it enters the do while loop and display the second row instead of first row as what you expects
the displaying of query starts from the second row sinse you are fetching twice as it begin.
my advice is you can remove the line 11 fetcher =)
sorry but I don't get what does require_once("../includes/config.php");and require_once("../includes/dbconnect.php"); does. before what I learn is really basic. What is requires inside this includes?
to answer your question require_once is just the info of your database and server connection which is in your code the $conn = mysql_connect("localhost", "root", "") or die ("Could not connect to server"); and $db = mysql_select_db("Smartlocker", $conn) or die ("Could not connect to database"); part