Jump to content

Retrieving database problem


wenxi

Recommended Posts

<?php

$ID = $_GET['listing'];

 

echo "You have clicked $ID";

$first = $_GET['first_name'];

?>

 

<?php //connect to database here

$dbhost1 = 'localhost';

$dbuser1 = 'root';

$dbpass1 = '';

 

$conn1 = mysql_connect($dbhost1, $dbuser1, $dbpass1) or die(mysql_error());

 

$dbname1 = 'studportal';

mysql_select_db($dbname1);

 

$query = "SELECT * FROM user where user_id= '$ID'";

 

$result = mysql_query ($query) ;

 

 

echo $_get['first_name'];

//echo $first;

/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */

 

?>

 

 

if you need the full page, i can email to you

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.