RE: [PHP-DB] RE: Row order

From: Date: Thu, 12 Jul 2001 01:05:57 +0000
Subject: RE: [PHP-DB] RE: Row order
Groups: php.db 
Request: Send a blank email to php-db+get-10305@lists.php.net to get a copy of this message
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:MIKUSCH@ica.bc.ca] // Sent: Wednesday, 11 July 2001 11:28 PM // To: php-db@lists.php.net // 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:stefan@microform.se] // Sent: Wednesday, July 11, 2001 4:10 AM // To: php-db@lists.php.net // 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: php-db-unsubscribe@lists.php.net // For additional commands, e-mail: php-db-help@lists.php.net // To contact the list administrators, e-mail: // php-list-admin@lists.php.net //

« previous php.db (#10305) next »