Jump to content

Php4 To 5 Problem


Hooch

Recommended Posts

Hey all.The following script worked in PHP4, but I cannot see the problem for it not to work in PHP5Here is the error... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/public_html/admin_cats.php on line 74

		if(isset($_GET['cat']))		{			$catTbl = $_GET['cat'];			$query  = mysql_query("SELECT * FROM `cat" . $cat . "`");			//Show the new button 1st			echo '   <span class="txtbox-small"> <a href="admin_cats.php?new_cat=' . $catTbl . '" class="light-10-link">New Category</a> </span>';			echo '   for ' . $catLevel;			echo '<br><br>';			while($r = mysql_fetch_array($query))			{				echo '<div class="left_box_100">';				echo '<a href="admin_cats.php?edit_cat=' . $r['id'] . '&catTbl=' . $cat . '" class="light-14-link">Edit</a>';					echo '  <a href="admin_cats.php?delete_cat=' . $r['id'] . '&catTbl=' . $cat . '" class="light-14-link">Delete</a>';				echo '</div>';				echo '<div class="right_box">    ' . stripslashes($r['cat']) . '</div>';				echo '<hr>';			}		}

Line 74 is

while($r = mysql_fetch_array($query))

Thank you for your time and help

Link to comment
Share on other sites

I found the problem

$query  = mysql_query("SELECT * FROM `cat" . $cat . "`");

" . $cat . "seems to be the culprit.This has to be a variable for the code to work.I'll post back if I fix the error.In the meantime I will keep checking for suggestions.ty**EDIT**Found the error.$cat should be $catTblI am so worried about the transfer to 5 I am expecting big problems when it'sthe normal typos.Thanks for looking anyway.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...