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 ? Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.