The code below is intended to retrieve the first,last names and a picture from 2 database tables. My dream is to display someone's picture with their names below or besides it, but I get a blank display. table1 stores names, table2 stores pictures. but it is not working. Can someone help??
Thank you
--------------------------
------
<?php
$db_name = "af";
$table_name1 = "biz"; --names table
$table_name2 = "pic"; --picture table
$connection = @mysql_connect("xxxx", "yyyy", "zzzz") or
die("could not establish a connection");
$db = mysql_select_db($db_name, $connection) or
die("could not select the database");
$sql = "
select
biz.first_name,
biz.last_name,
pic.bin_data,
pic.filetype
from $table_name1,
$table_name2
where
biznames.first_name = \"specimen\" or
biznames.id = 1 and
pic.id = 1
";
$result = mysql_query($sql,$connecti
on);
while ($row = mysql_fetch_array($result)
)
{
$first_name = $row['first_name'];
$last_name = $row['last_name'];
$bin_data = $row['bin_data'];
$filetype = $row['filetype'];
$display_block .= "
<p>-----------------------
----------
--------</
p>
<strong>$first_name $last_name</strong>.
<img src="getdata.php3?id=1"> --gives me pass error <p>-----------------------
----------
---------<
/p>
";
}
$data = @MYSQL_RESULT($result,0,"b
in_data");
--???
$type = @MYSQL_RESULT($result,0,"f
iletype");
--???
Header( "Content-type: $type"); --???
echo $data; --???
?>
<html>
<head>
<title>Display Page</title>
</head>
<body>
<?php echo "$display_block"; ?>
</body>
</html>
--------------------------
----------
Note: ---??? I don't understand the use of these lines either.
Start Free Trial