Jump to content

URL query


slashpine

Recommended Posts

If I wanted to write a (GET) query into a URL...

Lets say I have a query that is is displayed in HTML table format...how can I make one of the displayed (data) fields hyperlinked to the above mentioned query/url ?

I need the URl to grab two variables from the same record where it resides

typical record consists of  'NAME' ,'ADDRESS', 'CITY'. 'PHONE', (not displayed) 'ID', 'CATEGORY' ($category is the original variable from the original query)

the Query would look something like" SELECT name,address,city,phone, from _table WHERE city='$city' AND category='$category' order by name";

Is this possible?

What would the syntax of the URL be to get the results ?
Link to comment
https://forums.phpfreaks.com/topic/30292-url-query/
Share on other sites

Is this help?

You can seperate the query string by using "&"

[code]
<a href="filename.php?city=YourCity&category=YourCategory"> Your Link </a>
[/code]


Your db query may link this
[code]
$city = $_GET['city'];
$category = $_GET['category'];
$sql = " SELECT name,address,city,phone, from _table WHERE city='$city' AND category='$category' order by name";
[/code]

Link to comment
https://forums.phpfreaks.com/topic/30292-url-query/#findComment-139460
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.