2005/9/18, Jasper Bryant-Greene <[EMAIL PROTECTED]>:
> 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.
> 
> The same page can easily handle both.
> 
> <?php
> $sql = "SELECT * FROM mytable";
> 
> if(isset($_GET['year']) && !empty($_GET['year'])) {
>         $sql .= " WHERE year=" . intval($_GET['year']);
> }
> 
> $result = mysql_query($sql);
> ?>


Well, if you have control on everything, this approach would be the
best, no trick, easy to understand and maintain.

-- 
Pooly
Webzine Rock : http://www.w-fenec.org/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to