Solved

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

Posted on 2002-05-03
4
177 Views
Last Modified: 2006-11-17
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
Comment
Question by:owarnes
4 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 50 total points
ID: 6989303
Something like this?

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

??
0
 
LVL 2

Expert Comment

by:jpoesen
ID: 6989611
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question