I've spent a few hours and I can't figure out the error. It's so darn simple it's hard
Why won't it echo the database?
Database Not Echoing Properly
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Database Not Echoing Properly
If even your test echo is not printing, that means your WHILE loop isn't running. I would start investigating there to see what you are actually getting into the $row. If $row is empty the first time the WHILE runs, it will be skipped.
The indelible lord of tl;dr
Re: Database Not Echoing Properly
Well if I take this out of the file:Jackolantern wrote:If even your test echo is not printing, that means your WHILE loop isn't running. I would start investigating there to see what you are actually getting into the $row. If $row is empty the first time the WHILE runs, it will be skipped.
Code: Select all
while ($row = mysqli_fetch_array($user_query, MYSQLI_ASSOC)) {
This is the actual echo statement I use to list the items:
Code: Select all
echo "<tr align='left'><td><img src = '".$row['image']."'height='100' width='100'></td><td>$row[name]</td><td>$row[strength]</td><td>$row[defense]</td><td>$row[price]</td><td><A href='buy_item.php?randid=$row[randid]'><font color='red'>Buy Item</font></td></tr>";
Re: Database Not Echoing Properly
Oh Lord.... I had for location : United States..... it's supposed to be United States of America
Thanks for telling me to further dig into the while and see the rows.
Thanks for telling me to further dig into the while and see the rows.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm