This is my SQL statement:
UPDATE approved_student SET barcode='11',phone='11',table_name='2',remark='' WHERE
studentid='5230010'; UPDATE approved_student SET
barcode='22',phone='22',table_name='2',remark='' WHERE studentid='5230009';
Executing the SQL using PHP is not resulting in the desired outcome.
PHP source:
mysql_connect("localhost","root","1234"); //connect database
mysql_select_db("lasto");//select name of the database
if($sql=mysql_query($data1)){
echo 1;
}else{
echo $data1;
}
mysql_close();
I sent the SQL using POST, but it does not work.
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.