A
Anonymous
Guest
Hi there. I am new to SQL and i eed to find out how to update a record. I have record ID's so i want to update the record according to the id
ie the record currently
record_id: 1
first_name: Digitalbloke
last_name: Smith
change to
record_id: 1
first_name: John
last_name: Smith
But sometimes i may change the last name so it needs to read in both values first and last name.
also why do i get the query failed error for
Thanks in advance for your help!
ie the record currently
record_id: 1
first_name: Digitalbloke
last_name: Smith
change to
record_id: 1
first_name: John
last_name: Smith
But sometimes i may change the last name so it needs to read in both values first and last name.
also why do i get the query failed error for
Code:
$dbuser = "yyy";
$dbpass = "xxx";
$dbserver = "ppp.com";
$dbdb = "db";
$chandle = mysql_connect($dbserver, $dbuser, $dbpass)
or die("Connection Failure to Database");
mysql_select_db($dbdb, $chandle) or die ($dbdb . " Database not found. " . $dbdb);
$sql = "DELETE FROM 'page_data' WHERE 'id' = '" . $id . "'";
mysql_db_query($dbdb, $sql) or die("Failed Query of " . $sql);
Thanks in advance for your help!