Rv: Showing search results with links ... sorry forgot to post php code

--0-571200420-1256855540=:96583
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi there i`got this php script that shows results when the user type letter=
s in a searchbox, stretching the results every time the user enters a new l=
etter. But i would like every result shown, to have a link to a specific ht=
ml page, how can i do that. I mean i am using a small guestbook example tha=
t i found there, that uses mysql php ajax to do the job of polling the resu=
lts out of the mysql database, but i have to implement this with a very lar=
ge database that shows parts wich have unique part number and i have more t=
hat 3500 parts so i don`t know how to do this can anyone point me the right=
direction?=0A=0AThanks =0A=0AJuan=0A=0APS: Sorry this is the code =0A=0A<?=
php=0Adefine(HOST, "localhost");=0Adefine(USER, "root");=0Adefine(PW, "root=
");=0Adefine(DB, "ymad");=0A=0A$connect =3D mysql_connect(HOST,USER,PW)=0Ao=
r die('Could not connect to mysql server.' );=0A=0Amysql_select_db(DB, $con=
nect)=0Aor die('Could not select database.');=0A=0A$term =3D strip_tags(sub=
str($_POST['search_term'],0, 100));=0A$term =3D mysql_escape_string($term);=
=0A=0A$sql =3D "select nombre,telefono from directory where nombre like '%=
$term%' or telefono like '%$term%' order by nombre asc";=0A=0A$result =3D m=
ysql_query($sql);=0A=0A$string =3D '';=0A=0Aif (mysql_num_rows($result) > 0=
){=0A while($row =3D mysql_fetch_object($result)){=0A $string .=3D "<b>=
".$row->nombre."</b> - ";=0A $string .=3D $row->telefono."</a>";=0A $=
string .=3D "<br/>\n";=0A }=0A=0A}else{=0A $string =3D "No matches!";=0A}=
=0A=0Aecho $string;=0A?>=0A=0A=0A Yahoo! Cocina=0A=0AEncontra las mej=
ores recetas con Yahoo! Cocina.=0A=0A=0Ahttp://ar.mujer.yahoo.com/cocina/
--0-571200420-1256855540=:96583--
Juan Stiller [ Do, 29 Oktober 2009 23:32 ] [ ID #2021054 ]
PHP » gmane.comp.php.database » Rv: Showing search results with links ... sorry forgot to post php code

Vorheriges Thema: Very old question: Mysql and old authentication
Nächstes Thema: Showing search results with links