hi, i have this code and i wanted to match a record field name i.e. primary key with a image name, but i cant get it to work, i cant think of anything else how to do it
heres the code
[PHP]
<?php
include "db.private ";
header("Content-type: image/jpg");
$name = $_REQUEST["name"];
$connection = mysql_connect($ hostname,$usern ame,$password);
mysql_select_db ($databaseName) ;
$sql = "SELECT image FROM images WHERE name = '".$name."'" ;
$result = mysql_query($sq l);
$nrows = mysql_num_rows( $result);
if($nrows == 1) {
$row = mysql_fetch_arr ay($result);
echo $row["image"];
}
?>
[/PHP]
"db.private " here is my login details which has passwords and all that
i cant get this to work and match it with a feild name and then display the image
[PHP]$sql = "SELECT carID FROM car_name WHERE name = '".$name."'" ;[/PHP]
and im using this code here...
[HTML]print "<img src=getImg.php? name=" . $name . ">";[/HTML]
to display on anther php php file
heres the code
[PHP]
<?php
include "db.private ";
header("Content-type: image/jpg");
$name = $_REQUEST["name"];
$connection = mysql_connect($ hostname,$usern ame,$password);
mysql_select_db ($databaseName) ;
$sql = "SELECT image FROM images WHERE name = '".$name."'" ;
$result = mysql_query($sq l);
$nrows = mysql_num_rows( $result);
if($nrows == 1) {
$row = mysql_fetch_arr ay($result);
echo $row["image"];
}
?>
[/PHP]
"db.private " here is my login details which has passwords and all that
i cant get this to work and match it with a feild name and then display the image
[PHP]$sql = "SELECT carID FROM car_name WHERE name = '".$name."'" ;[/PHP]
and im using this code here...
[HTML]print "<img src=getImg.php? name=" . $name . ">";[/HTML]
to display on anther php php file
Comment