PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
divx
Forum Newbie
Posts: 20 Joined: Sun Jul 01, 2007 1:37 pm
Post
by divx » Sat Aug 04, 2007 6:44 am
connected to database
"INSERT INTO a ('b') values ('c') where id = e"
a = table name
why doesnt the above work?
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Sat Aug 04, 2007 7:13 am
Why would you INSERT to a row that exists? You need UPDATE
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Sat Aug 04, 2007 8:22 am
d11wtq wrote: Why would you INSERT to a row that exists? You need UPDATE
Or REPLACE and instead of using a WHERE clause, just set id.
ody
Forum Contributor
Posts: 147 Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK
Post
by ody » Thu Aug 09, 2007 3:59 pm
Problems:
1. You have quotes around the column name, use back ticks instead.
2. Your INSERT has a WHERE clause.