[PHP-DB] RE: Row order

2001-07-11 Thread Mikusch, Rita

Good Morning,

You could create a form and save your variables as hidden elements of your
form. I've never tried it without having an actual visible form on the page
with a submit button and everything, but it should work.

The only other ways I can think of are pretty long winded...cookies,
database entries, file entries...

Good Luck,

Rita.

-Original Message-
From: Stefan Doverud [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 4:10 AM
To: [EMAIL PROTECTED]
Subject: Row order


Hello!

I have this little problem sorting a search result by different fieldnames.

I do my search, get a quite impressive amount of variables that I use in my 
MySQL-query, and by default use ORDER BY name.

But I want to be able to klick on different headers to sort like ORDER BY 
$order.

The problem that I encounter is that I lose all the variables from the 
search when I refresh the document. Is it possible to resend all variables 
without inserting them in the A-tag ?
(like A href=find.php?var1=$var1..)

Hopefully someone has a smart solution.. =)

regards

  - Stefan


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] RE: Row order

2001-07-11 Thread Beau Lebens

If you created each column name on the table (i assume that's how this is
working) and then as rita said, dump the searched variables as hidden
inputs, then you could have something like this happen;

form name=reorder action=?php echo $PHP_SELF ? method=POST
input type=hidden name=first_var value=myVal
input type=hidden name=second_var value=yourVal
input type=hidden name=sort value=

a href=javascript:document.reorder.sort.value='position';
document.reorder.submit();Sort By Position/a

/form

which sets the value of the empty $sort input field to position and then
submits the form, so you can look for $sort and assuming it's a valid field
name, do something like
SELECT * FROM people ORDER BY  . $sort

HTH
Beau

// -Original Message-
// From: Mikusch, Rita [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 11 July 2001 11:28 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] RE: Row order
// 
// 
// Good Morning,
// 
// You could create a form and save your variables as hidden 
// elements of your
// form. I've never tried it without having an actual visible 
// form on the page
// with a submit button and everything, but it should work.
// 
// The only other ways I can think of are pretty long winded...cookies,
// database entries, file entries...
// 
// Good Luck,
// 
// Rita.
// 
// -Original Message-
// From: Stefan Doverud [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, July 11, 2001 4:10 AM
// To: [EMAIL PROTECTED]
// Subject: Row order
// 
// 
// Hello!
// 
// I have this little problem sorting a search result by 
// different fieldnames.
// 
// I do my search, get a quite impressive amount of variables 
// that I use in my 
// MySQL-query, and by default use ORDER BY name.
// 
// But I want to be able to klick on different headers to sort 
// like ORDER BY 
// $order.
// 
// The problem that I encounter is that I lose all the 
// variables from the 
// search when I refresh the document. Is it possible to resend 
// all variables 
// without inserting them in the A-tag ?
// (like A href=find.php?var1=$var1..)
// 
// Hopefully someone has a smart solution.. =)
// 
// regards
// 
//   - Stefan
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]