I am adding a search feature to a newspapers webpage...
I am getting this error on the page that I am submitting to:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\mirror\searchresults.php on line 12
Here is the Code:
<?php
if ((isset($submit))!=1)
{
$searchfield=$HTTP_POST_VARS['searchfield'];
}
require("connection.php");
$sql = "Select * FROM articles WHERE articletext is like $searchfield";
$result=mysql_query($sql,$link_id);
//
while ($row=mysql_fetch_array($result))
{
$headline=$row["headline"];
echo $headline;
}
?>
I am just trying to output the main headline of each article which matches the keyword search