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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.