Joshua F Posted January 2, 2010 Share Posted January 2, 2010 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 More sharing options...
trq Posted January 2, 2010 Share Posted January 2, 2010 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. Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986978 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 K, now it shows it all, but the tables aren't there now. If you would like a preview, I can give you link. Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986979 Share on other sites More sharing options...
trq Posted January 2, 2010 Share Posted January 2, 2010 You still need the opening <tbody> and closing </tbody> tags before and after the loop. Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986981 Share on other sites More sharing options...
trq Posted January 2, 2010 Share Posted January 2, 2010 Actually, your markup is all over the place, but that isn't a php issue. Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986982 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 Any idea on how to fix it? Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986985 Share on other sites More sharing options...
trq Posted January 2, 2010 Share Posted January 2, 2010 Have a look at where your closing </center> tags are. Also, its <thead> not <thread>. None if this is php related. If your having html issues, we have a html board. You should really look at using css as well instead of defining styles inline. Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986987 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 I have a CSS, and I think I got it working. I'll post back if I did. Edit: It's all good now, thanks . Link to comment https://forums.phpfreaks.com/topic/186895-every-things-fine-cept-it-dont-show-it/#findComment-986989 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.