Hi, I'm trying to get a simple search query of a table of news articles working. But it keeps giving me an error for the "mysql_fetch_array( )" on line 34. I can't see what I've done wrong.
#create the query
$sql = "
SELECT text
FROM article
WHERE text like '%$search%'
order by date desc";
#execute the query
$rs = mysql_query( $sql, $conn );
#loop through all records
while ( $row = mysql_fetch_array( $rs ) )
{
echo( $row["text"]. "<br>");
}
This is the section of the code that doesn't work. I've most likely made a silly mistake, but I can't spot my error. Please help me out here please. :o