Duckz Posted September 5, 2007 Share Posted September 5, 2007 Hi all I use phpMyAdmin to query a sql database as follows: SELECT hesk_categories.name AS category_name, count( * ) AS number_of_tickets FROM `hesk_tickets` JOIN `hesk_categories` ON hesk_tickets.category = hesk_categories.id WHERE `dt` BETWEEN '2007-08-01' AND '2007-09-01' GROUP BY category If I use phpMyAdmin to convert this sql query to PHP i get the following: $sql = 'SELECT hesk_categories.name AS category_name, count( * ) AS number_of_tickets ' . ' FROM `hesk_tickets` ' . ' JOIN `hesk_categories` ON hesk_tickets.category = hesk_categories.id ' . ' WHERE `dt` ' . ' BETWEEN \'2007-09-02\' ' . ' AND \'2007-09-31\' ' . ' GROUP BY category'; Fine so far. What I'd like to have is a webpage with to forms to enter the dates for 'BETWEEN' and 'AND' then have it post these automatically to the PHP script, query the database and give the results on the webpage. Does anybody know how I would do this? Cheers Lee Quote Link to comment https://forums.phpfreaks.com/topic/68074-posting-to-a-php-script/ Share on other sites More sharing options...
Daniel0 Posted September 5, 2007 Share Posted September 5, 2007 Make an HTML form where you can select (using a <select>) the date or enter it into an input field. Send the data to the PHP script and insert them into the query. Run the query and fetch the results and echo them. Quote Link to comment https://forums.phpfreaks.com/topic/68074-posting-to-a-php-script/#findComment-342241 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.