PHP Query for WHERE MySQL Statement not working
Posted: Sun Sep 10, 2006 5:58 am
Hi, i'm working on a slideshow,
I'm using a query string that should dictate which image etc is displayed.
I'm using this query in a WHERE statement, comparing it to the primary key of the row to select the relevant information.
BUT, the only thing it brings back is:
Resource id #5
My code is below:
further down:
I'm totally stuck, please help!?
I'm using a query string that should dictate which image etc is displayed.
I'm using this query in a WHERE statement, comparing it to the primary key of the row to select the relevant information.
BUT, the only thing it brings back is:
Resource id #5
My code is below:
Code: Select all
if (!empty($_REQUEST)) {
$slide = $_REQUEST["slide"];
}
else {
$slide = 1;
}
$img = mysql_query("SELECT img FROM slides WHERE pkey = '$_REQUEST[slide]'");Code: Select all
<?php echo "<img src=\"" . $img . "\" />"; ?>