Jump to content

displaying picture


franknu

Recommended Posts

ok I just have a problem displaying a picture, i only see the square of the picture but not picture. i have the path in my database the colum is called

Picture1

here is my  code

[code=php:0]

$query = "SELECT * FROM `business_info` WHERE `Categories` LIKE '%".$Categories."%'";
$result = mysql_query($query) or die (mysql_error());
$num_result = mysql_num_rows($result);
  echo "<table>";
if($num_result <= 0){
    echo("No Results found.");
    exit;
}
//include login row
  echo "<tr>";
  echo "<td>";
echo "<a href=\"authorization/login.php\"> Login</a>";
  echo "</td>";
  echo "</tr>";
  //inlude topsearch
  echo "<tr>";
  echo "<td>";
include("includefiles/topsearch.php");
  echo "</td>";
  echo "</tr>";

  //business found row
  echo"<tr>";
  echo"<td div align='right' bgcolor='DFDFDF'>";
  echo"Number of business found:".$num_result." ";
  echo"</td>";
  echo"</tr>";




while($row = mysql_fetch_array($result)){
//picture
echo"<table>";

echo "<tr>";

echo "<td valign='top'>";

echo "<img src='$Picture1' width=150 height=125>"; ???


//business colums

echo"</td>";

echo "<td valign='top'>";

$bn = $row['BusinessName'];

echo "<a href=\"bizwebpage2.php?BusinessName=$bn\">$bn</a>";



echo "<br>";
echo ($row["Slogan"]);
    echo "</strong><br>Address: ";
    echo (stripslashes($row["Business_Address"]));
    echo "<br>State: ";
    echo (stripslashes($row["make"]));
    echo "<br>City: ";
    echo (stripslashes($row["type"]));
    echo "<br>Tel: ";
    echo (stripslashes($row["Tel"]));

echo"<hr>";


echo "</td>";


//////second line


echo"<td valign='top'>";
require_once("includefiles/side_business_banner.php");
echo"</td>";
///end of line

echo "</tr>";
echo "</table>";

echo"</td>";
echo"</tr>";
echo"</table>";
}
[/code]

everything shows up fine except for the picture
Link to comment
Share on other sites

Ok i have a colum in the database call Picture1 where all the databata that is upload goes too,

so how do i set that up in my code because it should just display what is there with no problem

here is my full code:

[code=php:0]

$host = "localhost";
$username = "townsfin_localho";
$password = "abc123";
$database = "townsfin_contacts";

$Categories = addslashes ($_POST['Categories']);
$make = addslashes ($_POST['make']);
$type = addslashes ($_POST['type']);

if(!$Categories ||!$make||!$type){
  echo "You have not enter all fields";
  exit;
  }
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());


$bizwebpage2 = (isset($_FILES['bizwebpage2']) ? $_FILES['bizwebpage2']:'');
$Picture1 =  (isset($_FILES['Picture1']) ? $_FILES['Picture1']:'');


if(isset($_GET['Categories'])){
    $Categories = addslashes($_GET['Categories']);
    }
    else {
    echo("");
}
$query = "SELECT * FROM `business_info` WHERE `Categories` LIKE '%".$Categories."%'";
$result = mysql_query($query) or die (mysql_error());
$num_result = mysql_num_rows($result);
  echo "<table>";
if($num_result <= 0){
    echo("No Results found.");
    exit;
}
//include login row
  echo "<tr>";
  echo "<td>";
echo "<a href=\"authorization/login.php\"> Login</a>";
  echo "</td>";
  echo "</tr>";
  //inlude topsearch
  echo "<tr>";
  echo "<td>";
include("includefiles/topsearch.php");
  echo "</td>";
  echo "</tr>";
 
  //business found row
  echo"<tr>";
  echo"<td div align='right' bgcolor='DFDFDF'>";
  echo"Number of business found:".$num_result." ";
  echo"</td>";
  echo"</tr>";
 
 

 
while($row = mysql_fetch_array($result)){
//picture
echo"<table>";

echo "<tr>";

echo "<td valign='top'>";

echo "<img src='$Picture1' width=150 height=125>";


//business colums

echo"</td>";

echo "<td valign='top'>";

$bn = $row['BusinessName'];

echo "<a href=\"bizwebpage2.php?BusinessName=$bn\">$bn</a>";



echo "<br>";
echo ($row["Slogan"]);
    echo "</strong><br>Address: ";
    echo (stripslashes($row["Business_Address"]));
    echo "<br>State: ";
    echo (stripslashes($row["make"]));
    echo "<br>City: ";
    echo (stripslashes($row["type"]));
    echo "<br>Tel: ";
    echo (stripslashes($row["Tel"]));

echo"<hr>";


echo "</td>";


//////second line


echo"<td valign='top'>";
require_once("includefiles/side_business_banner.php");
echo"</td>";
///end of line

echo "</tr>";
echo "</table>";

echo"</td>";
echo"</tr>";
echo"</table>";
}

[/code]

help
Link to comment
Share on other sites




ok when i go to source code i get the link like this

<img src='/home/townsfin/public_html/business_images/r.gif' width=150 height=125>

but still it is not displaying pictures

This is my new code.
[code=php:0]

echo "<img src='" . $row['Picture1'] . "' width=150 height=125>";

[/code]

ok when i go to source code i get the link like this

<img src='/home/townsfin/public_html/business_images/r.gif' width=150 height=125>

but still it is not displaying pictures
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.