PDA

View Full Version : [PHP] Help



Luno1599
04-02-2008, 06:23 PM
Hey,

I need some help with 2 things, the first thing is...

1. How to make a php search so it will bring up every product relating to what the user put into the box... it will echo it, so say the user put in PC.. it would show all the products with PC in the title

The second thing is...

2. Say I had alot of products in a row... well how do i make it so when it like echos 10 it will put a link at the bottom so it will go to like page 2 and echo the rest and so on so it will look like...

< Page 1, 2,3,4,5,.....>

PHP code would help aswell as some guidance

Danny

MrCraig
04-02-2008, 09:11 PM
1:
use eregi =]

eg


<?php
$g_sql = mysql_query("select * from relating");
while($l = mysql_fetch_array($g_sql))
{
if(eregi($searchfor,$l[description]))
echo("$l[name]<br />");
}
?>


Something like that

And for second, use the limit function in the mysql_query

Luno1599
04-02-2008, 11:11 PM
thanks for your reply but can anyone explain the 2nd one abit more?
thanks

Hypertext
04-02-2008, 11:16 PM
Arrays.... or use zoom search =)

Caleb
04-02-2008, 11:24 PM
Arrays.... or use zoom search =)
What the hell are you talking about?



-----

@Thread starter, Google: PHP + MySQL pagination.

It just has to do with the LIMIT and WHERE ;)

Luno1599
05-02-2008, 07:02 PM
Can anyone help with the 2nd bit?

Dan

Want to hide these adverts? Register an account for free!