I want to update a row in my database. There is only one row in this database no other rows will be added at this stage.
I am using this PHP code but it does not update the value gives me error:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(credits) VALUES ('')' at line 1
This is my code
<?php
$con = mysql_connect("localhost","stingin_epanic","****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("stingin_epanic", $con);
$sql="UPDATE avis_credits (credits)
VALUES
('$_UPDATE[credits]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Number added thank you";
mysql_close($con);
?>
I know it is something Stupid But Really battelling here
mysql_*functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.$_UPDATEdefined? That's no a standard PHP superglobal...