Jump to content

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


markspencer

Recommended Posts

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:

[b]story.php[/b]

<?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>";?>





[b]story2.php(this is use to call the image)[/b]

<?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;


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.