Jump to content

Every thing's Fine, Cept it don't show it..


Joshua F

Recommended Posts

Hello, I am working on something that is MYSQL(Uses it to get info) and PHP. But my script im using doesn't work. I get no errors, it just doesn't load the info in the database.

 

 

Heres my Code:

<table class="tables" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" id="resultTable">

<b><font size="3" face="Arial, Helvetica, sans-serif"><br /><br /><center>Item List</center></font></b>

<thread>
<tr bordercolor="hh.png" bgcolor="#000000"> 
<th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th>
<th width="30%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th>
<th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th>
</tr>
</thread>
<?
$list_q = mysql_query("SELECT * FROM grandex ORDER BY name desc") or die ("An error has occured: " . mysql_error());
while($list_b=mysql_fetch_array($list_q)) {
	}
?>
<tbody>
<tr class="tablee">
<td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_b['name'];?></b></font></td></center>
<td width="30%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_b['itemid'];?></center></font></td>
<td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center>Coming Soon</font></td></center>
</tr>
</tbody>

Link to comment
https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/
Share on other sites

Your not actually doing anything within your while loop.

 

<?php
if ($list_q = mysql_query("SELECT * FROM grandex ORDER BY name desc")) {
  if (mysql_num_rows($list_q)) {
    while($list_b=mysql_fetch_array($list_q)) {
?>
<tr class="tablee">
<td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?php echo $list_b['name'];?></b></font></td></center>
<td width="30%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?php echo $list_b['itemid'];?></center></font></td>
<td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center>Coming Soon</font></td></center>
</tr>
<?php
    }
  } else {
    echo "No results found";
  }
} else {
  trigger_error(mysql_error());
}
?>

 

ps: Using php's short tags is never a good idea.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.