Re: What is the best way to reorder table columns...temp tables?
| From: | Chris Lee | Date: | Tue, 18 Dec 2001 16:57:38 +0000 |
| Subject: | Re: What is the best way to reorder table columns...temp tables? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78102@lists.php.net to get a copy of this message | ||
man that is nasty, but imho because of the constant in and out of php
echo "
<a
href='$PHP_SELF?reports.php?userid=$userid&date_start=$date_start&date_end=$
date_end&order_by=trans_per_req%20desc&groupby=$groupby&type=other&daterange
=$daterange'>link </a>
";
I came across this same problem, I hate the long urls, their ugly, so I
wrote a simple session class to carry my prefs across a page.
carry_class.egn
http://www.mediawaveonline.com/examples/
$carry->add('position');
$carry->add('order_by');
$carry->add('order_by_dir');
$carry->add('search');
$carry->add('search_keyword');
$carry->add('search_category');
echo "
<a href='$PHP_SELF?order_by=people_name&carry_keep='>order by name</a>
<a href='$PHP_SELF?order_by=people_email&carry_keep='>order by email
address</a>
<a href='$PHP_SELF?order_by_dir=1&carry_keep='>up</a>
<a href='$PHP_SELF?order_by_dir=0&carry_keep='>down</a>
<a href='$PHP_SELF?position=$prev&carry_keep='>back</a>
<a href='$PHP_SELF?position=0&carry_keep='>home</a>
<a href='$PHP_SELF?position=$next&carry_keep='>next</a>
";
--
Chris Lee
lee@mediawaveonline.com
"J. Roberts" <jroberts@nuitari.com> wrote in message
news:CLELKGECCHFHPNEDDINBIEIPCAAA.jroberts@nuitari.com...
> I'm trying to update a report generator I have, using php and mysql.
> The setup is essentially listing employees and production data.
>
> What I did when I created it was for the column headers, made them links
> to requery the database..sample link follows (inside an anchor tag):
> "reports.php?userid=<?php echo $userid; ?>&date_start=<?php echo
> $date_start; ?>&date_end=<?php echo $date_end;
> ?>&orderby=trans_per_req%20desc&groupby=<?php echo $groupby;
> ?>&type=other&daterange=<?php echo $daterange; ?>"
>
> As you can see that is very ugly, and inefficient.
>
> I was thinking that one way to get around passing so many parameters was
> after the initial query, have that inserted into a temporary table. Then
> all that would need to be passed with the query string would be an ORDER
BY
> clause, at which time I would do a SELECT * FROM TEMP_TABLE ORDER BY
> $orderby.
>
> One thing im not sure about, is if temporary tables are unique to each
user.
> That is to say if two people were running reports at the same time with
> different
> parameters, would that work? If so, how long before the connection dies?
> If
> it is at the end of script execution, that wouldn't be much help.
>
> Does anyone have any better ideas as well? I thought about using a
> multi-dimensional
> array, but was told that that would be a bad idea to keep a large array
> alive
> in memory.
>
> Thanks,
>
> -Jamison
>
> (hope this makes some sense)
>
>
>
>
>