samoi Posted December 2, 2008 Share Posted December 2, 2008 <html> <head> <title> My task </title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> </head> <body> <?php error_reporting(E_ALL & E_NOTICE); require_once('config.php'); $sql = "SELECT * FROM samoi ORDER BY id DESC"; $result = mysql_query($sql) or die(mysql_error()); echo '<table height="20%" width="100%" border="1"> <tr> <th> EVENT </th> <th> DATE </th> </tr>'; echo "<tr>"; echo "<td>"; while ($samoi = mysql_fetch_assoc($result)) { echo $samoi['event']; echo "</td>"; echo "<td>"; echo $samoi['date']; echo "</td>"; echo "</tr>"; echo "</table>"; } ?> <br /> <div align="center"> click here to <a href="insert.php"> ADD an EVENT </a>. </div> </body> </html> I just created this code, and when I run it it gives me this output: EVENT DATE ظ…طµظ„ط ظ…طµظ„ط [look at this guys !! ]------>MEMEmemomemosamoisamoinawaf11/22/3333ENG 102, delever12/05/2008 click here to ADD an EVENT . {{It doesn't come as a table !!}} Quote Link to comment https://forums.phpfreaks.com/topic/135090-solved-while-command-i-need-help-with-pulling-data-out-of-the-mysql-in-a-table/ Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 Hmm not sure whats wrong, but not really looking. Did notice though this line error_reporting(E_ALL & E_NOTICE); doesn't need the E_NOTICE as E_ALL is all the errors. Quote Link to comment https://forums.phpfreaks.com/topic/135090-solved-while-command-i-need-help-with-pulling-data-out-of-the-mysql-in-a-table/#findComment-703657 Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 Study your code carefully, you're not outputting a table. You're outputting the top of a table, and then several table bottoms. Quote Link to comment https://forums.phpfreaks.com/topic/135090-solved-while-command-i-need-help-with-pulling-data-out-of-the-mysql-in-a-table/#findComment-703661 Share on other sites More sharing options...
samoi Posted December 2, 2008 Author Share Posted December 2, 2008 Study your code carefully, you're not outputting a table. You're outputting the top of a table, and then several table bottoms. Ok, I've studied it carefully. but it seems to be ok, I don't know if there is any other missing code. Quote Link to comment https://forums.phpfreaks.com/topic/135090-solved-while-command-i-need-help-with-pulling-data-out-of-the-mysql-in-a-table/#findComment-703682 Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 add print_r($samoi); inside the while loop and see what it says. Quote Link to comment https://forums.phpfreaks.com/topic/135090-solved-while-command-i-need-help-with-pulling-data-out-of-the-mysql-in-a-table/#findComment-703684 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.