Reputation: 151
So I am having issues with the first row of the database being left out, not sure as to why yet. Here is the code in a nutshell, leaving out the connection part and such.
$tickets="tickets";
$sql_ticket="SELECT * FROM $tickets WHERE username='$user'";
$ticket_query=mysql_query($sql_ticket);
$ticket_data=mysql_fetch_assoc($ticket_query);
while($ticket_data=mysql_fetch_assoc($ticket_query)){
// echoing in tables
}
Upvotes: 0
Views: 70
Reputation: 75629
Remove this line:
$ticket_data=mysql_fetch_assoc($ticket_query);
as you are fetching 1st row outside of your loop. Corrected code should be:
$tickets="tickets";
$sql_ticket="SELECT * FROM $tickets WHERE username='$user'";
$ticket_query=mysql_query($sql_ticket);
while($ticket_data=mysql_fetch_assoc($ticket_query)){
// echoing in tables
}
Upvotes: 4