Jump to content

[SOLVED] UPDATE two rows with two WHERE statements


gamefreak13

Recommended Posts

This is just ridiculous. This is sooooo simple and I can't figure it out. And yes "name" and "uname" are different.

 

UPDATE mytable SET name='John', ip='68.10.721.209' WHERE uname='test' AND ip='68.10.721.209'

 

My table (before running this query) contains

 

user 68.11.21.2 Travis

test 68.11.21.2 Jason

test 68.10.721.209 Steve

user 68.10.721.209 Mike

 

My table (after running this query) contains

 

user 68.11.21.2 Travis

test 68.10.721.209 John

test 68.10.721.209 John

user 68.10.721.209 Mike

 

My query is only respecting the "where uname = test" part. It doesn't care about the ip even though I told it to only update for that ip.

Thanks but it seems my error was I was missing a single quote ( the ' thing ) at the end. When I copied it in to the post I had copied it from a different text file which was correct, but when I copied it in to my script I missed the last single quote.

 

Don't ya just hate it when the stupid little things drive you nuts?

 

But while we have this thread.. are "AND" and "&&" the same thing?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.