Jump to content

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


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;


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