Is this query OK?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Is this query OK?

Post by Perfidus »

Is this query OK?
I want to introduce datas in one filr of the table:

Code: Select all

$sql = "INSERT INTO Ciudad WHERE (Nombreciudad='$Localidad') ( du_acceso, de_acceso, ing_acceso)" .   
"VALUES ('$du_acceso', '$de_acceso', '$ing_acceso')";
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

no, insert does not take WHERE clause. Are you looking for UPDATE?
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Post by Perfidus »

Yes, why not?
If it works...
How does it look like?
I can check the manual anyway, thanks!
mwong
Forum Commoner
Posts: 34
Joined: Sun Dec 28, 2003 2:58 am

Post by mwong »

Yeh...Insert is to insert a NEW row. There can't be a condition for that. UPDATE is probably what you're looking for
Post Reply