Jump to content

[SOLVED] sql update in php


hasek522

Recommended Posts

I am trying to create an update statement but cannot seem to get it to work.  If some one could take a look at it for me I would greatly appreciate it.

 

$sql = "UPDATE stylists SET

'firstname=". $firstname . "', 'lastname="

. $lastname. "', 'address="

. $address. "', 'city="

. $city. "', 'state="

. $state. "', 'zip="

. $zip. "', 'salon="

. $salon. "', 'specialty="

. $specialty. "', 'education="

. $education. "', 'experience="

. $experience. "', 'phone="

. $phone. "', 'email="

. $email. "', 'website="

. $website. "', 'description="

. $description . "' WHERE id=".$_SESSION['USERID'].")";

mysql_query($sql) or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/119218-solved-sql-update-in-php/
Share on other sites

Ok heres my new statement :

 

$sql = "UPDATE stylists SET firstname='{$firstname}', lastname='{$lastname}', address='{$address}',

city='{$city}', $state='{$state}', zip='{$zip}', salon='{$salon}', specialty='{$specialty}',

education='{$education}', experience='{$experience}', phone='{$phone}', website='{$website}',

description='{$description}' WHERE id=".$_SESSION['USERID'];

 

Here is the error:

 

Unknown column 'California' in 'field list'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.