Hello ,

Can anybody tell me that is wrong in this statement
$data = mysql_query("SELECT Column1 FROM '$tbl_name' WHERE Column2 = '$image'");
I then tried
echo $data; - But no result
Basically i want to retrieve the value of Column1 where the value of Column2 is equal to the value stored in variable $image

Recommended Answers

All 3 Replies

Change that echo with:

while($row = mysql_fetch_object($data))
{
    echo $row->Column1;
}

bye!

Wow......cereal bro thanks for the help once more but i get this now
mysql_fetch_object(): supplied argument is not a valid MySQL result resource
I assure you that the connections are good as an insert query works fine

Fixed it myself :D
Good statement is
$data = mysql_query("SELECT Column1 FROM $tbl_name'WHERE Column2 = '$image'")

The rest , cereal bro shwos it clearly how to echo successfully

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.