Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If you use GET to pass through data

Status
Not open for further replies.

meeble3

Programmer
Nov 8, 2004
52
GB
how do you retrieve it on the next page.

I want to do $result = mysql_query("SELECT * from centres where id = '$theid'",$db);


Where $theid is brought from the previous page

Thanks
 
Variable via get are gotten via the Super Global array $_GET
 
Code:
$result = mysql_query("SELECT * from centres where id = " . $_GET['theid'],$db);
It will be in the $_GET superglobal. If id is an integer you should omit the quotes around the value, if it is a string, you should keep the quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top