PHP Code: 
<?php

$db 
mysql_connect($hostname,$username,$password);
if(!
$db){
    echo 
'Failed to connect to database. Check your info';
    }
@
mysql_select_db($database) or die( "Unable to select database");
$id $_GET['id'];

$query "SELECT * FROM post WHERE id = $id";
$result mysql_query($query) or die(mysql_error());
mysql_close();

$data mysql_fetch_array($result);

/* Debug statements
 * echo "<pre>";
 * print_r($data);
 * echo "</pre>";
 */

echo "<br />ID: " $data['id'];
echo 
"<br />Title: " $data['title'];
echo 
"<br />Cover: " $data['cover'];
echo 
"<br />Info: " $data['info'];
?>
Hope that helps.

Make sure you add proper conditional statements before making the query, t3o did that
Halcyon Reviewed by Halcyon on . Displaying result from MySQL ? (Help !) I'm currently learning how to insert data in MySQL database and fetching data from MySQL database. I have learned how to insert, but displaying the result from MySQL is giving me some problems. This is the command to create the tables. I'm confused with the id structure and I guess thats the main root of the error I'm getting at the output. $query="CREATE TABLE post (id int NOT NULL auto_increment,title text(300) NOT NULL,cover text NOT NULL,info text NOT NULL,PRIMARY KEY (id),UNIQUE id Rating: 5