mysql - PHP UPDATE DATABASE error -


i have problem code. have update, doesn't update db, , don't know why.. can me? please?

$query = "update company set name, address, latitude, longitude,  about, cui, time, date, phone name=$name, address=$address,  latitude=$latitude, longitude=$longitude, about=$about, cui=$cui,  time=$time, date=$date, phone=$phone";     $result = mysql_query($query); 

this not correct syntax of update.

correct structure of update statement is:

update [table_name] set field_one = '$field_one', field_two = '$field_two' field_name = '$field_value' 

also, need add single quotes field values not int defined in database.

updated query:

$query = "update company set name = '$name', address='$address',  latitude='$latitude', longitude='$longitude', about='$about', cui='$cui',  time='$time', date='$date', phone='$phone'  [add_your_condition] "; 

note: don't use mysql_ functions. deprecated ones , removed in new php versions. use pdo or mysqli_ instead.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -