slashpine Posted December 12, 2006 Share Posted December 12, 2006 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 residestypical 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 More sharing options...
mansuang Posted December 12, 2006 Share Posted December 12, 2006 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.