// 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?

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')";

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.