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
https://forums.phpfreaks.com/topic/81839-solved-cannot-select-table/
Share on other sites

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.