Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/68074-posting-to-a-php-script/
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.