hi everyone, im writing a xhtml toplist script, i need help with two little things, the search function and edit site function. i want to know whats wrong with these two queries
$sites = mysql_query("SELECT id, sitename FROM wiz_sites WHERE cid='".$cid."' AND description LIKE '".$word."' OR keywords LIKE '".$word."' ORDER BY id, sitename");
for the search function and for the edit site
$sitename = $_POST["sitename"];
$sitelink = $_POST["sitelink"];
$sitelogo = $_POST["sitelogo"];
$keywords = $_POST["keywords"];
$description = $_POST["description"];
$cid = $_POST["cid"];
if($sitename=="")
{
echo "Site Name Cannot be left Blank";
}else if($sitelink=="")
{
echo "Site Link Cannot be left Blank";
}else if($description=="")
{
echo "description Cannot be left Blank";
}else if($keywords=="")
{
echo "Keywords Cannot be left Blank";
}
else{
$res = mysql_query("UPDATE wiz_sites SET sitename='".$sitename."', $sitelink='".$sitelink."', logourl='".$sitelogo."', cid='".$cid."', description='".$description."', keywords='".$keywords."' WHERE id='".$site."'");
if($res)
{
echo "Site updated successfully
";
echo "Add this link on your site where users can see
";
echo "http://$siturl/in.php?site=$site
";
}else{
echo "Error Adding Site, Please Contact Owner";
}
}
[code] i get the error field [code]Error Adding Site, Please Contact Owner
Your mysql query is wrong,it sud be
$res = mysql_query("UPDATE wiz_sites SET sitename='".$sitename."', sitelink='".$sitelink."', logourl='".$sitelogo."', cid='".$cid."', description='".$description."', keywords='".$keywords."' WHERE id='".$site."'");