Solved

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

Posted on 2002-05-03
4
171 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now