i have this function
function update_job($title, $type, $salary, $country,
$city, $state, $category,$date,
$description, $responsabilities,
$requirements, $id_job ) {
$HOST_DB ="localhost";
$NAME_DB="jobs";
$USER_DB ="root";
$PWD_DB="";
$connect = mysql_connect($HOST_DB, $USER_DB, $PWD_DB);
$db=mysql_select_db($NAME_DB);
$requete_insert_tem = "UPDATE employment SET title = $title , type = $type , salary = $salary , country = $country , city = $city , state = $state , category = $category , date = $date , description = $description , responsabilities = $responsabilities ,
requirements = $requirements where id = $id_job ";
mysql_query($requete_insert_tem)
or die(mysql_error());
}
but an error appears "Syntax error near 'street , category = informatique , date = 01/07/2013 , description = nothing' "
You need to use single quotes around strings. Below I assume that all your columns are some string type. You also need to stop using mysql_
functions immediately as they are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which.
$requete_insert_tem = "UPDATE employment SET title = '$title' , type = '$type' , salary = '$salary' , country = '$country' , city = '$city' , state = '$state' , category = '$category' , date = '$date' , description = '$description' , responsabilities = '$responsabilities' , requirements = '$requirements' where id = '$id_job'";