It echo's out Problems Occured and i also get this error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/layoutst/public_html/Graphics/category.php on line 51
can anyone tell me what im doing wrong with the sql fetch?
$fetch = mysql_query ( "SELECT * FROM categories LEFT JOIN parents ON ( categoryParentID = parentID ) WHERE categoryPerm = '".$category."' LIMIT 1" );
if ( mysql_num_rows ( $fetch ) == 1 )
{
$category = mysql_fetch_assoc ( $fetch );
}
else
{
echo 'Problems Occured! ';
}
$limit = LIMIT;
$fetch = mysql_query ( "SELECT 1 FROM graphics WHERE graphicCategoryID = '".$category['categoryID']."'");
$totalPages = ceil ( mysql_num_rows ( $fetch ) / $limit );
if ( mysql_num_rows ( $fetch ) == 0 )
{
header ( "Location: /Graphics/" );
}
echo '<center><span class="catlinks"><a href="/Graphics/"><b>Home</b></a> - <a href="/Graphics/'.$category['parentPerm'].'.html"><b>'.$category['parentName'].'</b></a> - <a href="/Graphics/'.$category['parentPerm'].'-'.$category['categoryPerm'].'.html"><b>'.$category['categoryName'].' Graphics</b></a></span></center>';
if ( $page > $totalPages )
{
$page = $totalPages;
}
$start = ( $page * $limit ) - $limit;
echo '<div align="center">';
$fetch = mysql_query ( "SELECT * FROM graphics WHERE graphicCategoryID = '".$category['categoryID']."' ORDER BY graphicID DESC LIMIT $start, $limit" );
while ( $row = mysql_fetch_assoc ( $fetch ) ) // this is line 51
It echo's out Problems Occured and i also get this error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/layoutst/public_html/Graphics/category.php on line 51
you see anything wrong with the say im executing the sql fetch?