Problem with MYSQL + PHP

Posted on Saturday 11th August 2007 at 04:00 PM
Diablosblizz
Diablosblizz's Avatar
Hey, I am trying to make my own news system for my site. So far, I LOVE IT! But... problems lie ahead.

I have everything working, it display's the subject and message. If there is something in the $message variable it will display read more.

My problem is with the read more... Here is the code:

PHP Code
  1. case 'readmore':
  2. $id = $_GET[id];
  3. $newsie = mysql_query("SELECT * FROM `news` WHERE `id` = '$_GET[id]'");
  4. echo '<div align="center"><table width="90%" border="0" cellspacing="0" cellpadding="0">
  5. <tr>
  6. <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  7.  
  8. <tr>
  9. <td width="1%" align="left" valign="top"><img src="images/blue_top_left.gif" width="7" height="7" /></td>
  10. <td width="98%" background="images/blue_top.gif"></td>
  11. <td width="1%" align="right" valign="top"><img src="images/blue_top_right.gif" width="7" height="7" /></td>
  12. </tr>
  13. <tr>
  14. <td background="images/test.png" style="background-repeat: repeat-y; background-color: #305F7F"></td>
  15. <td bgcolor="#305F7F" style="padding-bottom: 3px;"><div align="center"><span class="title">';
  16. echo $newsie[subject]; echo '</span></div></td>
  17.  
  18. <td background="images/blue_right_side.gif" bgcolor="#305F7F" style="background-position: right; background-repeat: repeat-y"></td>
  19. </tr>
  20.  
  21. </table></td>
  22. </tr>
  23. <tr>
  24. <td><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#000000">
  25. <tr>
  26. <td><table width="100%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF" style="padding: 5px;">
  27. <tr>
  28.  
  29. <td><font size="1"><center>';
  30. break;


That's just the "readmore" case. You see where it says $newsie[subject]? Well where that variable is defined is where the subject SHOULD show up, but it doesn't.

Does anybody have any ideas.
Posted on Saturday 11th August 2007 at 04:20 PM
DanielXP
DanielXP's Avatar
You have not fetched it.

PHP Code
  1. $newsie = mysql_query("SELECT * FROM `news` WHERE `id` = '$_GET[id]'");
  2. $newsie = mysql_fetch_array($newsie);
Posted on Saturday 11th August 2007 at 05:13 PM
Diablosblizz
Diablosblizz's Avatar
Wow, I am stupid. Thanks Dan.
Posted on Saturday 11th August 2007 at 06:22 PM
DanielXP
DanielXP's Avatar
Locked :)
Topic is locked