Need to show us more code.

For instance: where is $srchrow set?

Next, change:
if ($submit){

if (ISSET($submit)) {

Why are you over-writing $name, $details, $price, $imgloc with list() before
you even use them?

-----Original Message-----
From: Dave Carrera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 1:40 PM
To: php List
Subject: [PHP-DB] A while loop prob ?

Hi All

What have I done wrong here.

3 yes 3 hours I have been plaing with this loop.

All it shows is the last record in my db.

It should show and record containing any string in the search.

Error works

Please help I beg you.......

As always thank you for any help

Dave C

--------- My Code Starts Here ------------

if ($submit){
        if($search == ""){
        $error1 = "<font color=red>No Records found. Please use at least
1 character in search box</font>";
        $srchsql = "select * from $tbn where name like \"%$search%\" ";
        $srchresult = mysql_query($srchsql, $con);
        $name =$srchrow['name'];
        $details =$srchrow['details'];
        $price =$srchrow['price'];
        $imgloc =$srchrow['imgloc'];
        while (list($name, $details, $price,

$display_srch_rows =

Dave Carrera
Website Designer

PHP Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to