Re: [PHP] how to move one element of an array to the end of thearray

2001-10-19 Thread Tom Beidler
Chris, Good solution but I should have mentioned we're running PHP 4.04 and I was getting an undeclared function with array_search. I tried using array_keys without luck. Here's as far as I got; while ($make_row = mysql_fetch_array ($make_result)) { if (in_array ("No model s

Re: [PHP] how to move one element of an array to the end of thearray

2001-10-19 Thread Tom Beidler
Trying to use the solution without positive results First need to clarify, I'm actually trying to order the model. Here's my original query; $make_query = "SELECT make.make, model.model, application.make_id, application.model_id FROM application INNER JOIN make ON make.id = application.make_id I

Re: [PHP] how to move one element of an array to the end of thearray

2001-10-19 Thread Christopher William Wesley
Splice the array at the point in your result array where "No make specified" is, for one element, then append it back onto the result array. Here ... $noMake = array_splice( $resultArray, array_search( "No make specified", $resultArray ), 1); // This should be one line, sorry :) $newResults = a