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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.