Hi,
In my site i set a serach engine page.Which customer could put key word and find the user name in database,
I set in one page will show 40 people. If over 40 the page will set to be other next page..
Well, everything work fine at the 1st page, But when i click on the 2nd page or next page to see the result ...those next page is empty.Seem like the page knows how many record in that keyword but can not show the record in next page...then evrything is empty on next page...
I got stress too much, I never have problem about this if i specify only one name one result....
But this i use trimm to explode the key word i dont know where to fix it
Alex
3 2127
Hi,
In my site i set a serach engine page.Which customer could put key word and find the user name in database,
I set in one page will show 40 people. If over 40 the page will set to be other next page..
Well, everything work fine at the 1st page, But when i click on the 2nd page or next page to see the result ...those next page is empty.Seem like the page knows how many record in that keyword but can not show the record in next page...then evrything is empty on next page...
I got stress too much, I never have problem about this if i specify only one name one result....
But this i use trimm to explode the key word i dont know where to fix it
Alex
I have a feeling that your not properly using SQL's LIMIT. Without seeing any of your code it's hard to tell, please post some code and we can probably help you further.
Greg
Heya, Paitoon.
Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).
If you're getting a blank page, your script is probably generating an error. Check out this article to find out what is going on.
ok the main script is here; -
<? //////////THis is the script that i put above the head doccument/////////
-
$page=$_GET[page];
-
if ($page=="") {
-
$page=1;
-
}
-
$each=20; // specify number of image per one page//
-
?>
-
-
<? ////////This part is in body
-
$sql="select * from users where";
-
$check=0;
-
-
if ($sex<>"*") {
-
-
$sql.=" sex='$sex' ";
-
$check=1;
-
}
-
-
if ($lookfor<>"*") {
-
if ($check==1) {
-
$sql.=" AND lookfor='$lookfor' ";
-
} else {
-
$sql.=" lookfor='$lookfor' ";
-
}
-
$check=1;
-
}
-
-
-
-
-
$sql2="select * from users where sex='$sex' or lookfor='$lookfor' province'";
-
$result2=mysql_db_query($dbname,$sql2);
-
$total=mysql_num_rows($result2);
-
$totalpages=ceil($total/$each);
-
$goto = ($page-1)*$each;
-
-
-
$sql.=" order by username limit $goto,$each";
-
$result=mysql_db_query($dbname,$sql);
-
while ($rs=mysql_fetch_array($result)) {
-
$username=$rs[username];
-
$password=$rs[password];
-
$userid=$rs[userid];
-
-
?>
-
-
-
-
<? ///////////////// And this is the last
-
-
if ($totalpages>1) {
-
echo "<B>หน้า $page</B><BR>";
-
for ($i=1;$i<=$totalpages;$i++) {
-
echo "| <A HREF='search2.php?page=$i'>$i</A> ";
-
}
-
}
-
?>
everything work correctly,I set it to show 10 results each page..But when i click on the link to page number 2 it show wrong....i got all every information in database even i am not searching for it...But why the first page is work correctly...what should i do ?
Thank you so much for the further help
Alex
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Petre Huile |
last post by:
I have designed a site for a client, but they have hired an internet
marketing person to incrase their search engine ranking and traffic.
He wants to put extra-large fonts on every page which will...
|
by: Mark Goldin |
last post by:
I am working on a search engine.
An aspx page shows some data. The user will type something in and click a
button to search.
I want to create a server solution for the search engine. So the search...
|
by: ste |
last post by:
Hi there,
Further to my recent posts where I've received excellent help from Rik and
Jerry, I've ended up with an image gallery on my website that displays
images in a table, 3 images per row. ...
|
by: MDW |
last post by:
Posted this on another board, but evidently it was off-topic there...hope you
folks will be able to provide some guidance.
I've been working on a Web site for a business (my first non-personal...
|
by: Ed Jay |
last post by:
I generate a DHTML page (a medical report) with dynamically generated text
based on user input (answers to questions). The page length changes
dynamically. I desire that when the page is printed...
|
by: comp.lang.php |
last post by:
'll try to explain this as clearly as possible, sorry if it's unclear.
You have in your directory /foo 42 images
You have in your database metadata for 30 out of those 42 images
You have to...
|
by: shalini jain |
last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code.
Below is the code that...
|
by: ArizonaJohn |
last post by:
Hello,
The code below works great. The user enters a name into an HTML form, the code looks up a table with that name, and then that table is displayed.
I am trying to use pagination with it,...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |