Advertisement

07.29.2002 at 10:16AM PDT, ID: 20329632
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

How do I retrieve image and other info. from database?

Asked by Senyonjo in PHP Scripting Language

Tags: , , , ,

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,$connection);
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,"bin_data"); --???  
$type = @MYSQL_RESULT($result,0,"filetype"); --???
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
[+][-]07.29.2002 at 10:51AM PDT, ID: 7185974

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: retrieve, image, php, from, database
Sign Up Now!
Solution Provided By: majorspank
Participating Experts: 4
Solution Grade: B
 
 
[+][-]07.29.2002 at 12:44PM PDT, ID: 7186261

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2002 at 04:09AM PDT, ID: 7187663

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2002 at 11:08AM PDT, ID: 7194322

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2002 at 11:14PM PDT, ID: 7242719

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2002 at 11:16PM PDT, ID: 7242720

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32