Jump to content

Mysql Update


TheFilmGod

Recommended Posts

I'm trying to grab the value count from mysql and add one to it. This is very simple, but I"m still completely lost! here is the code:

 

require("connect.php");

$result = mysql_query("SELECT fav_count FROM favs WHERE page_id = $page");
$result++;
mysql_query("UPDATE favs SET fav_count = $result WHERE page_id = $page");

echo "Thank you for telling us you like this!<br />Please wait...";
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=link.php\">";

 

Any help is greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/43307-mysql-update/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.