hi all ..i'm working on php application .......and i need to insert data into a filed in my table but in a certain condition ......exp:(insert into users (posts) values(...) where ...) i can't do this .....what should i do ? please help and thnx in advance
weblover
0
Junior Poster
Recommended Answers
Jump to PostThere's no such thing as a conditional insert, it just appends to the end of the table. Do your conditional in PHP.
Jump to PostIf you're trying to modify an already existing row take a look at
UPDATE which can take a WHERE clause
http://dev.mysql.com/doc/refman/5.0/en/update.htmlThere is also REPLACE. It acts like INSERT but if a row …
Jump to PostIs there any difference in those or did you post three copies of the exact same thing?
Jump to PostIt's ok. I'll clean out the first two. I didn't want to delete them if there actually was a slight edit in the code that you intended.
All 40 Replies
ShawnCplus
456
Code Monkey
Team Colleague
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
ShawnCplus
456
Code Monkey
Team Colleague
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
weblover
0
Junior Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Designer_101
-2
Posting Whiz
weblover
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.