Jump to content


PHP News system


1 reply to this topic

#1 Ignatheos

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 04 June 2007 - 11:49 AM

Hello, I'm new to PHP, yet is a language i look for to control, i was trying to make this tutorial http://www.ngxdesigns.com/tutorials/view/?...=view&id=13, and when I run it it gives-me this Error
"Add News Topic
Hello and welcome to the News administration. From here you can add, delete and modify news topics. You may have to click here? for effects to take place. Un-Validated
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/workshop/public_html/admin.php on line 26
Validated
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/workshop/public_html/admin.php on line 55"

I checked it out and found it both have something to be with

Line 26

while($row = mysql_fetch_array($query)) {
echo"
<table width='100%''>
<tr>
<td width='50%'>
$row[title]
</td>
<td width='10%'>
<a href='$self?action=delete&id=$row[id]'>Delete</a>
</td>
<td width='10%'>
<a href='$self?action=mod&id=$row[id]'>Modify</a>
</td>
<td width='10%'>
<a href='$self?action=view&id=$row[id]'>View</a>
</td>
<form action='$self?action=valid&id=$row[id]' method='post'>
<td width='10%'>
<input type='submit' name='submitvalid' value='Validate?'>
</td>
</form>
</tr>
</table";
}

echo"";

And line 55

while($row = mysql_fetch_array($query)) {
echo"
<table width='100%''>
<tr>
<td width='50%'>
$row[title]
</td>
<td width='10%'>
<a href='$self?action=delete&id=$row[id]'>Delete</a>
</td>
<td width='10%'>
<a href='$self?action=mod&id=$row[id]'>Modify</a>
</td>
<td width='10%'>
<a href='$self?action=view&id=$row[id]'>View</a>
</td>
</tr>
</table";
}

echo"";

And I wonder what am I doing wrong, I hope someone can help me to figure this out.

Thanks .
Ignatheos

#2 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 04 June 2007 - 11:54 AM

Wrong forum buddy, tho I'm pretty sure a mod will move it soon

Either way, you need to show us the actual query, thats where the problems is at





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users