Hi,
I want to be able to update my info on a database. I do it by going through a form I created with the values filled in it already. My problem is when I write the SQL statement I can not get the structure right. So the database only has one field modified. How do I get the rest of the statment to be executed. It is only a basic language structure problem.
<?php
session_start();
// open the connection
$conn = mysql_connect("localhost","",""
;
// pick the database to use
mysql_select_db("database1", $conn);
// create the SQL statement
$sql = ["UPDATE place SET address = '$_POST[address]' where specials= '$_SESSION[idno]'";
"UPDATE place SET f_name = '$_POST[f_name]' where f_name= '$_SESSION[idno2]'";
"UPDATE place SET l_name = '$_POST[l_name]' where l_name= '$_SESSION[idno3]'";]
// execute the SQL statment
if (mysql_query($sql, $conn)) {
echo "special changed!";
}else{
echo "something went wrong";
}
?>
I want to be able to update my info on a database. I do it by going through a form I created with the values filled in it already. My problem is when I write the SQL statement I can not get the structure right. So the database only has one field modified. How do I get the rest of the statment to be executed. It is only a basic language structure problem.
<?php
session_start();
// open the connection
$conn = mysql_connect("localhost","",""

// pick the database to use
mysql_select_db("database1", $conn);
// create the SQL statement
$sql = ["UPDATE place SET address = '$_POST[address]' where specials= '$_SESSION[idno]'";
"UPDATE place SET f_name = '$_POST[f_name]' where f_name= '$_SESSION[idno2]'";
"UPDATE place SET l_name = '$_POST[l_name]' where l_name= '$_SESSION[idno3]'";]
// execute the SQL statment
if (mysql_query($sql, $conn)) {
echo "special changed!";
}else{
echo "something went wrong";
}
?>