Re: $_get 2 variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Gavin Amm <gavin@ksg.com.au>:

> Hi,
> 
> I'm wanting to retrieve data from my database using 2 conditions in the
> WHERE clause.
> How do i pick up 2 different variables from the URL?
> 
> i can get just 1 variable easily (eg:
> http://localhost/myscript.php?var1=blah)
> My question essentially is: what string do do i need to type into the URL to
> pick up the 2 variables like this:
>   $var1 = $_GET['var1'];
>   $var2 = $_get['var2'];
> 
> Do I need to start messing around with strings? or is there an easy way?
> 
> Thanks,
> Gav

Try:
http://localhost/myscript.php?var=foo&var2=bar
'&' is the default url parameter seperator.  The rest of your code looks fine. 
(course there are lots of other ways to go about it).

--Ryan


-- 
Ryan T. Gallagher
ryan@studiesabroad.com
International Studies Abroad
http://www.studiesabroad.com
(512)480-8522



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux