Jump to content

Any errors here??


NextGenForum.net

Recommended Posts

		if($total_results >0){
	$rs = mysql_query($sql);
	$j =1;
	while($line = mysql_fetch_assoc($rs)){
			include('results_stub.tpl');
			$j++;
	}

	}
	else{
			 echo "Try searching again";

	}
	if($last != 1){
					 echo "Pages: ";
					 for($i=1;$i<($last+1);$i++){
					 		echo '<a href="?search_text='.$search_txt.'&pagenum='.$i.'">'.$i.'</a> | ';										 
					 }
	}


}

 

Can you see any errors here??

 

www.selectgreen.co.uk When you click go leaving the box empty you get this; Try searching againPages:

 

Im guessiong its a code error thats causing this. Any help appreciated thanks

Link to comment
Share on other sites

No errors really, just misplaced logic.

 

So you have $total_results at 0, then it goes to your else line, which does the first Try searching again echo, then $last appears to not equal 1 so you get your next echo of Pages:

 

So if that is a valid logic flow for your code, then just put a BR after Try searching again so it puts Pages on the next line.

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.