<?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $SQL = " UPDATE pick20 "; $SQL = SET timescompleted=55; $SQL = SELECT * FROM pick20 WHERE timescompleted=timescompleted; $result = mysql_db_query($db,"$SQL",$cid); if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); } } mysql_close($cid); ?> Code (markup): It says this part is wrong: $SQL = SET timescompleted=55;
should it not be $SQL = mysql_query("UPDATE pick20 SET timescompleted=55") or die (mysql_error()); $SQL = mysql_query("SELECT * FROM pick20 WHERE timescompleted=timescompleted") or die(mysql_error());
mysql_connect("localhost", $loginname, $password) or die (mysql_error()); mysql_select_db("$dbconnect") or die (mysql_error()); where $loginname = your login name, $password = your password and $dbconnect = the database you want to connect to
What if I want to make timescompleted go up by 1 everytime a new entry is made with the same email address. So say we have this: kyle 1 max 2 john 1 and if we get kyle 1 max 2 john 1 john 1 it changes both John's to 2?