Jump to content

This little piece of code is givin' me fits!


rodhow

Recommended Posts

I am past a beginner in php but no where near an expert and I need some help. This piece of code here:

 

$query .= " limit $s,$limit";

  $result = mysql_query($query) or die("Couldn't execute query");

 

is part of my search results page with paged indexes (next, previous 10, etc.). However with this code i get the die message but if i take the first line off ($query), the page executes but then the page doesn't operate correctly i.e. shows 15 results when the $limit(limit for rows) =10. Is it not written correctly or am I missing somethingwith the top line?

 

if the entire script is needed let me know and i will paste it? Thanks in advance for any help!

Okay I inserted the code and the structure worked properly  (ten results on one page, 1 to 10 of 14 results)...good. Thank you very much. However, if I click on the next ten link, it doesn't take me to those last four records, instead it takes me to a fresh page asking for me to submit another search. Im not sure why its doing that but I am grateful to get that part out of the way. Thanks a million!

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.