, could be html coding problem
or your data contains incomplete html like <table><tr><td>...but no closing
tags,
try

function genData($ID){
$sql=" select * from table where ID like   '%".$ID."%' ";
$sql_result=mysql_result($sql) or die($sql');

$r ="<table>";

whille($result=mysql_fetch_array($sql_result)){
  $r.=" <tr> ";
    for($ii=0;$ii<count($result);$ii++){

    $r.= " <td> ".htmlSpecialChars(stripslashes($result[$ii]))." </td> ";

    }
 $r.="</tr> ";

    }
$r.="</table>";
return $r;
}

echo genData($ID);




----- Original Message -----
From: "r.gelstharp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 05, 2001 2:28 AM
Subject: Re: [PHP-WIN] trouble with MySQL 'LIKE' command


> Done like you recommended with the select....like '%".$var."%' but it
still
> gives me empty rows of data.
>
> Everytime I try and search for something it returns with 7 rows of data,
all
> of which are blank. I'm using the basic mysql_num_rows to get the number
of
> rows of data it retrieves, and I'm using a WHILE($data =
> mysql_fetch_array($sql_result)) to output the rows of data.
>
> If it's not the SQL statement, what could be doing this? I ask in case
> you've heard this problem mentioned by some thick newbie like meself
before.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to