|
Alvaro, >The problem is that in the same php page I would like to choose either the >calculation from an especific year or the calculation from the whole table >using URL. That needn't raise a problem, especially in PHP. If the user chooses a year, have the page construct the appropriate WHERE clause. If she chooses "all", have the page remove any WHERE clause from the SQL statement. PB ----- Alvaro Cobo wrote: Thanks Pooly and Peter: The problem is that in the same php page I would like to choose either the calculation from an especific year or the calculation from the whole table using URL.An example: I have a table which shows how much money somebody has spent each year and there is the choice to know how much money they have spent from the begining of the data input (fields: id, person, expenses, year). I have built a dynamic page which shows a link with the years in the database, and an aditional link which selects "all" records. So when people chooses one of the year links, it sends an URL variable to the browser, which is collected by the sql script to the WHERE statement and then it filters the data and sum all the data from this specific year. But If they choose the "all" link, the filter just disapears, and the sql query makes a sum of the whole data. I guess, once the years are fixed data, Poolys approach could be very useful, because, I can configure the "all" link to send an URL variable with the '%' wildcard, and the year links could still send their data (2005, for example) which defines univocally each one of the records in the year field in the budget table. At the moment I was building two separate pages, so when people want the infiltered data, the hyperlink directs then to another page, but it is much better to have all the information in only one page, to make it easy the mainteinance. Thanks a lot guys. It was a great help from you. Very best regards, Alvaro. PD: Sorry, but my English is not very good this time. ----- Original Message ----- From: "Pooly" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Saturday, September 17, 2005 3:53 PM Subject: Re: Select ALL rows with WHERE statement 2005/9/17, Alvaro Cobo <[EMAIL PROTECTED]>: |
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.1/104 - Release Date: 9/16/2005
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
