• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

mysql replace/update????????

i need a query to replace first_name and surname on my candidates table on my database where email is = to $email

i have tried to write it, but mines says error. Can someone do it for me its frying my brain.

$query=
0
owarnes
Asked:
owarnes
1 Solution
 
BatalfCommented:
Something like this?

mysql_query("update candate set firstname='$newFirstname',lastname='$newLastname' where email = '$email'");

??
0
 
jpoesenCommented:
yep, that should do it.

owarnes, don't forget to put single quotes around variables you insert in a sql query :

$query = "select * from T1 where name=$namevar"
-> will NOT work

$query = "select * from T1 where name='$namevar' "
-> will work.

Good luck
jpoesen

 
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now