Page 1 of 1

Getting id from url

Posted: Mon Oct 11, 2004 2:43 pm
by hubble121
Hi im having a really simple problem - im new to php.

Ok on an url like .../test.php?id=61

im trying to get php to get the value of the id, the id is the MemberID in the database. Then i want to find the record in the database that matches thes MemberID (i.e. 4656) and then find the Username of that record. The username will then be defined by $UplineMember see code below.

Code: Select all

$id = $_GETїid]; 
$sql = "SELECT Username FROM $sqltable WHERE MemberID='$id'"; 
$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query - testing "'); 
list ($UplineMember) = mysql_fetch_row($sql_result);

Trouble is, that its not working

Please help?

Chris Hubble

Posted: Mon Oct 11, 2004 2:59 pm
by John Cartwright
DO NOT CROSS POST