Solved

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

Posted on 2002-05-03
4
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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.

734 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