snorky Posted May 15, 2009 Share Posted May 15, 2009 I want to create a link to a web page that will automatically execute the query that the user would do, if the user had to. I know it's done all the time, but I can't remember which sites use this technique. If I could find one, I would copy the techniques. To do the query now, the user accesses the main page for database access, and sees a list of criteria to perform the search. From there the user selects a few criteria, and then my PHP creates and executes the query that gives the user the desired results. For example, to view certain fields in table "phonelist1" where the the results only show names and phone numbers of all people located in building "BVE", the user goes to the "Select Criteria" page checks the box for Building BVE clicks the "Ask" button That creates the following query: select fname,lname,phone from phonelist1 where bldg="BVE"; That query displays a page that shows the results of the query: a table where the columns are fname,lname,phone rows are records of fname, lname, and phone I want to create a link that executes that query through the address bar on the browser. That way I don't require the user to make choices that would result in the above query. Remember: I have the databases and php working well. I just want to make the process easier for the end user. I've seen it in action. the URL looks something like http://www.mydomain.com/home.php?bldg="bve" home.php already has all the the php and sql, and is waiting for someone to ask... As always, the devil is in the details, and I can't remember all of the details. Link to comment https://forums.phpfreaks.com/topic/158282-create-a-url-that-executes-a-mysql-query/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.