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!

Link to comment
Share on other sites

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!

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.