I need some help and I don't really know whats happening so it'd be great if one of you masters could help me.
I've created a CMS for my tutorials and eerythings working except tutorials.php so I don't want no answers like check your dbconnect data.
And yes i've followed a tutorial to do it but I will be highly editing it.and adding a whole admin section just want to get it all up and running.
Heres the code:
<?php
include ("dbconnect.php");
if (isset($ID))
{
$tuts="SELECT * from yourtable where ID='$ID'";
$tuts2=mysql_query($tuts);
while ($tuts3=mysql_fetch_array($tuts2))
{
echo "
<table width=100% border=0 cellspacing=3 cellpadding=0>
<tr>
<td>
<font color=#82A1FF size=1 face=Verdana, Arial, Helvetica, sans-serif><b>$tuts3[title]</b><br>
<font color=#000000>By <b>$tuts3[user]</b><br>
<i>$tuts3[description]</i><br>
<br>
$tuts3[message]<br>
<br>
</td>
</tr>
</table>
"; }
}
else if(!isset($id))
{
$tut="SELECT * from yourtable";
$tut2=mysql_query($tut);
while($tut3=mysql_fetch_array($tut2))
{
echo "
<font color=#000000 size=1 face=Verdana, Arial, Helvetica, sans-serif>
<table width=250 border=0 cellspacing=3 cellpadding=0>
<tr>
<td width=42 height=42>
<div align=center><a href='tutorials.php?ID=$tut3[ID]'><img src='$tut3[avatar]' border='0' alt='$tut3[title]' target='main'></a></div></td>
<td width=208><font color=#82A1FF size=1 face=Verdana, Arial, Helvetica, sans-serif><strong>$tut3[title]</strong><br>
<font color=#000000><em>$tut3[date]</em><br>
By <strong>$tut3[user]</strong></font><br></font></td>
</tr></table>
"; }
}
?>
The error I get is:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/daniel/public_html/tutorials.php on line 36
- Dan
Edited by DanWilliamson, 28 January 2006 - 10:42 AM.
