I get an error message with mysql php update form!!!?
Hi there,
I’m trying that will cerate an application that revisions data in mysql.
It depends on THREE files
(1) Variety Records
(2) Redesign Form
(3) Redesign Function
The problem happens at the third file
recommendations the code
————————————–
<php
$host=”localhost”; // Particular name
$username=”protrain_ramize”; // Mysql username
$password=”tanabla”; // Mysql password
$db_name=”protrain_cpanel”; // List name
$tbl_name=”contact_info”; // Stand name
// Connect with server as well as select repository.
mysql_connect(“$host”, “$username”, “$password”)or die(“cannot connect”);
mysql_select_db(“$db_name”)or die(“cannot pick out DB”);
// redesign data inside mysql databases
$sql=”UPDATE $tbl_name FIXED name=’$name’, lastname=’$lastname’, email=’$email’ WHERE id=’$id'”;
$result=mysql_query($sql);
// whenever successfully current.
if($result)
replicate “Successful”;
replicate “
“;
replicate “View result“;
otherwise
replicate “ERROR”;
>
————————————–
For reasons uknown i obtain the ERROR communication.
Any ideas
We need guidance.Where you have the record:
replicate “ERROR”;
Replace it using the following (so we can see just what exactly the mistake is):
replicate mysql_error();
You have not set $id…
The remainder is syntax.
// Connect with server as well as select repository.
$link = mysql_connect($host, $username, $password) or perhaps die (“cannot connect”);
mysql_select_db($db_name) or perhaps die(“cannot select DB”);
// redesign data inside mysql databases
$sql = “UPDATE “.$tbl_name.” FIXED name = ‘”.$name.”‘, lastname = ‘”.$lastname.”‘, contact = ‘”.$email.”‘ WHERE id = ‘”.$id.”‘ “;
mysql_query($sql) or perhaps die (mysql_error());
replicate “View result“;
If you might be sure in relation to correctness of your respective table identify and career fields, there is no Error inside your Update statement.
— Also test, if the ID (WHERE id=’$id'”; ) is definitely text and also int form.because you’ve included estimates ( WI )
— Recheck the input parameters (if meets with facts type specified)
whenever nothing previously mentioned works, please send the complete error communication using
otherwise
replicate mysql_error();
lol.
Leave a Reply
You must be logged in to post a comment.