> $sqlStatement = "Select * from newStories where id =
> ".$GLOBALS['HTTP_GET_VARS']['id']. " order by whateverValue";

or 

$sqlStatement = "Select * from newStories where id = $ID order by whateverValue";

  _____  

~ Richard Allsebrook ~
Applications Developer and Webmaster
Easysoft Limited, Thorp Arch Grange, Thorp Arch, Wetherby, LS23 7BA, UK
http://www.easysoft.com <http://www.easysoft.com>  - http://www.cinema.com <http://www.cinema.com> 
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila."

  _____  

-----Original Message-----
From: cal [mailto:cal@calevans.com]
Sent: Monday, March 26, 2001 3:50 PM
To: Tristan.Pretty; php-db
Cc: cal
Subject: FW: RE: [PHP-DB] reading a URL...

Try:

$sqlStatement = "Select * from newStories where id =
".$GLOBALS['HTTP_GET_VARS']['id']. " order by whateverValue";

Then execute that statement.
The value ID that you passed in on the URL is stored in the associative
array $HTTP_GET_VARS.  Check the manual at www.php.net, there's a section on
variables and it has a list of re-defined variables.

HTH,
Cal
http://www.calevans.com

-----Original Message-----
From: Tristan.Pretty@risk.sungard.com
[mailto:Tristan.Pretty@risk.sungard.com]
Sent: Monday, March 26, 2001 8:26 AM
To: php-db@lists.php.net; php-general@lists.php.net
Subject: [PHP-DB] reading a URL...

'ello,

Is it Possible, in PHP to read a URL?

What I am trying to do is this...
I have many news stories in a database, and a single static news page, that
calls the story, and the corresponding headline.
I have looked about on-line, and seen a common URL,...

http://www.arandomsite.com/news_story.php?id=123

I have adopted this method, and it only displays the top most story in my
database, no matter what news ID I use.

Can I get the ID number from the URL?, and then pass that to the SQL
statement?

I cannot find a tutorial or similar on-line anywhere.

Hope you can help,
Tris...

P.S, after getting this all set up, my boss asked me to turn everything into
.jsp pages.
SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

**********************************************************************

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net