0

// this works

sql = "SELECT * FROM image_upload WHERE location='article' AND image_id='7'";

// this works

sql = "SELECT * FROM image_upload WHERE location='article' AND image_id='9'";

// this does not work

sql = "SELECT * FROM image_upload WHERE location='article' AND image_id='7' AND image_id='9'";

// I wonder why?

2
Contributors
1
Reply
11
Views
2 Years
Discussion Span
Last Post by DaveAmour
2

Because image_id cannot be both 7 and 9 right?

What is it you want to achieve?

Maybe

sql = "SELECT * FROM image_upload WHERE location='article' AND (image_id='7' Or image_id='9')";

Edited by DaveAmour: Extra help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.