On Wednesday 17 April 2002 08:21, Jason Soza wrote:
> Sorry, I just noticed that the count() function will do at least the
> first part of my question, i.e. SELECT year, COUNT(*) FROM cars GROUP
> BY year
>
> But the second part still has me a bit stumped. I know that you can
> pass a variable using something like script.php?year=1991, but doesn't
> that assume that in your script you have something like:
> $query = ("SELECT * FROM mytable WHERE year=$year")
>
> So the $year is the only variable that gets replaced by the script.php?
> year=1991 you called it with. How could I make it so that the
> entire 'year=$year' part of the query gets replaced by what comes after
> the ? in script.php?year=1991 ?
You can do something like:
script.php?qry=year%3D1991
%3D is the url encoding for '='.
Then in your script:
$query = ("SELECT * FROM mytable WHERE $qry")
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
The chief danger in life is that you may take too many precautions.
-- Alfred Adler
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php