Jump to content


Photo

images that is saved in the database is not displaying when i upload it in a free webhosting..?


  • Please log in to reply
1 reply to this topic

#1 markspencer

markspencer
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 February 2006 - 08:46 AM

why does the images that is saved in the database is not displaying when i upload it in a free webhosting..?
but in my Computer..localhost...it displays the pictures...
here is my code:

story.php

<?php

//check for record id

if ((!isset($_GET['id']) || trim($_GET['id']) ==''))
{
die('missing record!');
}

include('conf.php');

$connection = mysql_connect ($host, $user,$pass)
or die ('unable to connect');

mysql_select_db($db) or die ('unable to select database');

$id = $_GET['id'];
$query = "SELECT title, pic, content FROM news
WHERE id = '$id'";

$result = mysql_query($query)
or die ("Error in query : $query. " . mysql_error());

$row = mysql_fetch_object ($result);
?>

<?php echo "<img src='story2.php?id=$id' width=100 height=100 border=1>";?>





story2.php(this is use to call the image)

<?php
include('conf.php');

$connection = mysql_connect ($host, $user,$pass)
or die ('unable to connect');

mysql_select_db($db) or die ('unable to select database');

$query = "select pic,title from news where id='$id'";
$result = @MYSQL_QUERY($query);

$data = @MYSQL_RESULT($result,0,"pic");
$type = @MYSQL_RESULT($result,0,"title");


echo $data;


?>


#2 markspencer

markspencer
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 February 2006 - 05:00 PM

help me pls...............




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users