Jump to content

[SOLVED] php mysql problem


emma57573

Recommended Posts

Sorry its proberly just me being a learning novice or completly thick! but I cant work out why this isnt working:

 

The problem:

 

Click on 'bath & Beauty' under the categories on the right hand side (ie: accessories/art/bags etc)

http://www.misi.me.uk/store_info.php?id=54

 

It will take you to this page:

 

http://www.misi.me.uk/view_items.php?id=54&cid=4

 

 

Right theres my problem! The menus gone!

 

If you go to the url bar at the top and take out the category number '&cid=4'

so you basically go to: http://www.misi.me.uk/view_items.php?id=54

it then throws up an error which gives my a clue but I still cant work out the problem!

 

 

 

The menu on 'view_items.php' is the same script at 'store_info.php'

so Im guessing that my problem is something the store_info.php is sending (if that makes any sence?)

 

 

The script for the catergory menu is as follows:

            <?
  



$cats_query=mysql_query("select * from freetplclassified_categories where pid=$cid order by cat_name");
$cnt=1;
                        
while($cats=mysql_fetch_array($cats_query))
{

	$rst_query=mysql_query("Select * from freetplclassified_categories where pid=".$cats["id"] );
	$clist=$cats["id"];
	while ( $rst=mysql_fetch_array($rst_query) )
	{
				$clist.="," . $rst["id"];
			$thislist="-1," . $rst["id"];
			while ( $rst=mysql_fetch_array($rst_query) )
			{ 
				$clist.="," . $rst["id"];
				$thislist.="," . $rst["id"];
			//echo $rst["freetplcat_id"];
			}





   	$rst_query=mysql_query("Select * from freetplclassified_categories where pid in (" . $thislist . ")" );
	}

$freetplcat_str= " and  cid IN (" .$clist . ")" ;

$freetplq_job_cat="Select * from freetplclassified_products where approved='yes' and uid=$id and uid not in ($suspended_list) 
and UNIX_TIMESTAMP(DATE_ADD(date_submitted,INTERVAL auction_period DAY)) > UNIX_TIMESTAMP(NOW()) and 
status='open' $freetplcat_str";

$freetpltotal=mysql_num_rows(mysql_query($freetplq_job_cat));

//die();
if($freetpltotal >= 1)
{
  ?>
  <tr><? echo $id;?>
                  <td align="left"><font class='normal'> <a href="view_items.php?id=<? echo $id;?>&cid=<? echo $cats["id"];?>"> 
                  <? echo $cats["cat_name"]; ?></a></font> <font class="smalltext">(<? echo $freetpltotal; ?>)</font></td> 
                <?
  }
  ?><td width="2"></td></tr>
             <?
                
  if($cnt%1==0)
  {
  
              ?>
		  
		  <?
              
  }
  	$cnt++;
}
              
		            
?>

 

I know its a $freetpltotal problem but im not sure what the problem is.

 

Thank you

 

 

Link to comment
https://forums.phpfreaks.com/topic/112016-solved-php-mysql-problem/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.