I am creating a topsites script integrated into my site...
My topsites script will check if the user has created a topsites entry yet. If they haven't, it will run the INSERT query. If they have made an entry it will run the UPDATE query. My problem is if they choose a title/description/url the first time around, they can never edit it. Same problem happens AFTER they make an entry
but change the title/description/url to nothing. Hope I wasn't too confusing
my query 😃
if ($rows == 0) {
mysql_query("INSERT INTO site_topsites (userid, name, url, description) VALUES ('$user_data[ID_MEMBER]','$sitename','$siteurl','$sitedescription')");
} else {
mysql_query("UPDATE site_topsites SET name='$sitename', url='$siteurl', description='$sitedescription' WHERE userid='$data[0]'");
}
What's wrong?