Jump to content

[SOLVED] Cannot Select Table


ayok

Recommended Posts

Hi,

I've got a different result on my local server and web server.???

 

I created this page. On this page, you can find some company projects which are taken from mysql database. But I cannot get the data when I clicked on one of the project. No data is selected in the next page. However, the script is working properly if I tested it on my localhost.

 

Here is the php script on index.php

<?php
include "../../dbconnect/koneksi_db.php";
$result=mysql_query("SELECT * FROM project");
while ($data=mysql_fetch_array($result))
{
echo "<a href=detail.php?id=$data[proj_no]>$data[title] - $data[company]</A><BR>";
}

 

From this index page, we can click on one of the links to the project detail which goes to detail.php.

 

<?php

include "../../dbconnect/koneksi_db.php";
$result = mysql_query("SELECT * FROM project WHERE proj_no='$id'") or DIE(mysql_error());
$data = mysql_fetch_array($result);
$body_project = nl2br($data[body]);

echo "<h1 align='center'>$data[title]</h1>";
echo "Begin: $data[year]<br>Status: $data[status]<br>Bedrijf: $data[company]<br>";
echo "<p>$body_project</p>";
echo "<a href='file/$data[file]'>dossier downloaden<br>";
echo "<a href='index.php'>terug naar projecten</a>";
?>

In this page, the information cannot be shown in the browser.

 

Could anybody help me to find out what's wrong?

 

Thanks,

ayok

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.