Sorting A Table Into An Array In Mysql
Can someone tell me how to sort a table using a while function. This is what i want to do. I have table that has 17 fields, the first two are id and date and the rest of date..but what i want to do is take the data and sort it by the date and put the rest of the data under that date.
example:
date
Data
date
Data
I asume the array will look like this
result[0][0]
result[0][1]
result[1][0]
result[1][1]
and so on .....
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fetching Array From MySQL Table
Some told me to better learn some basics of php and mysql, but i encountered a problem that i couldn't solve with all the tutorials out there. I tried the following code to fetch an array from a MySQL table named Gallery: PHP Code:
Inserting Array Into Mysql Table
Anyone know the best way to insert an array from a form into a mysql table. My array is validated from the form and then inserted into the db, only when I SELECT it, it merely saya 'array' in the field.
Multidimensional Array In To A MySQL Table
Trying to load an multidimensional array into a MySQL table with columns as follows, level1,level2,level3,illust,item,description,partN o,qua,price,remarks,weight ,size,mass the array first line is $input[0][level1]Engine the array secondline is $input[0][level2]Cylinder Head etc.. A 'foreach' inside a 'foreach' echo of the array gives the following, which is correct. 0, level1, Engine 0, level2, Cylinder Head 0, level3, 0, illust, 001.pdf 0, item, 1 0, description, Casting 0, partNo, 238356 0, qua, 1 0, price, 1,245.00 0, remarks, This is for the Z350 series 0, weight, 5 0, size, 5x5x5 0, mass, 37 1, level1, Engine 1, level2, Cylinder Head 1, level3, 1, illust, 001.pdf 1, item, 2 1, description, Valve, inlet 1, partNo, 452790 1, qua, 4 1, price, 5.46 1, remarks, This is for the Z350 series 1, weight, 5 1, size, 5x5x5 1, mass, 37 2, level1, Engine 2, level2, Cylinder Head 2, level3, 2, illust, 001.pdf 2, item, 3 2, description, Valve, exhaust 2, partNo, 345436 2, qua, 4 2, price, 5.99 2, remarks, This is for the Z350 series 2, weight, 5 2, size, 5x5x5 2, mass, 37
Comparing PHP Array From Checkbox To MySQL Table
My problem involves updating a MySQL table using checkbox input. I'm relatively new to both PHP and MySQL so I'm looking for a little direction on the smartest way to accomplish my goal. When a user goes to a project page, they are able to categorize their project by area. The user checks a series of checkboxes and the results are stored in an arrays called $category_ids. I'll called the project id $project_id. What I want to do is compare the array $category_ids to entries in a MySQL table for $project_id. Then I want to add the links that aren't already in the table and delete the ones that need to be deleted. The table has these fields: projects_cat_link (table) ---------------------- category_id ¦ project_id (fields) Does anyone have any tips on how to do this? I've gathered that maybe there's a way to get the MySQL data into a similarly formed array and then use functions like array_diff to compare. But then I'm not sure how to use the comparison in a MySQL query to add/edit/delete the links.
Check If Any Items In An Array (php) Is In A Table (mysql).
I want to check if any of the items in a PHP array exist in a MySQL table. What is the best way to do this with making repeated calls to the database for each item? Actual application is: I have an array (in PHP) of serial numbers of units about to be shipped.I want to check the ship record (a table in a MySQL database) to check if that serial number has been used before. According to our quality policy we never reuse serial numbers, serial numbers are unique. So prior to printing the packing slip I want to warn the shipping guy/gal a serial number may be incorrect. I could brute force it and increment through the "to be shipped array" and check each item against the table. But that is, as I said brute force, and I am having to be concerned with system speed lately.
Putting An Array In A Mysql Database Table Field
I want to insert an array into my database but i've got a problem with it. Before i insert the array into the dbase i check if everything is in the array with print_r($array). Everything that should be in the array is in there so i insert it into the dbase. When i check my dbase with phpmyadmin the field that should contain my array has the word array in it so i assume the array is in the dbase. But when i retrieve the data from my dbase and check my array with print_r i get the following error: Warning: Argument to array_values() should be an array in.
Explode Text Area Into Array For MySQL Table
On my site, I have a textarea where users enter their sites' information in the following format (tab-delimited): Site Name <tab> Site Description <tab> URL <newline> Site Name <tab> Site Description <tab> URL <newline> (and so on...) I know I have to use the "Explode function and a loop to get the data into an array and enter it into a MySQL table. Would anyone have a snippet of code off-hand that could show me how to do this?
Sorting An Array Problem, (array/string Manipulation)
I have a function that I found on google, that goes through a directory and spits out a directory tree in an array, with arrays inside of arrays, and more and more arrays inside of arrays, depending on how many subdirectories are there..... Here is a sample "directory tree" it spits out. My problem is wanting to be able to create a new array containing only the paths to all the subdirectories it finds from this array, so it is with array manipulation... Not all paths are located in the topmost array's values, but some directories are within other subdirectories and so forth.. I'm stumped on how exactly to sort through this array, whether recursively or not to grab all the 'paths' in the array period. Code:
Sorting Sql Results In An Array Using Things Outside The Array To Sort Them?
I'm using PHP to connect to a database full of place names, and their associated post codes, latitude and longitude on the earth. A user types his or her post code into a form, plus a distance (in miles), and the script looks for other area codes (first half of the post code) within that distance. I can do that fine, but the results are ordered alphabetically by postcode, and I want to order it by the distance. Problem here, is that the distance isn't part of the array taken from the database, it takes the latitude and longitude of the area it's on in the while loop, and calculates the distance between the user's post code and that one, but it's not part of the array, so I can't sort the array using it. How can I sort it? Can I add the calculated distances to the array, and sort it using sort()? If yes, how do I add them to the array? Here's the page, just to explain better what the script does: http://navimaker.org/ed/owain/results.php?postcode=gl15&distance=34 Mess around with the postcode and distance vars. I'd put the source on here too but I'm doing all this over SSH and can't copy & paste very easily .
Table Sorting Logic
I have a table with 4 columns. I have each column header acting as an asc/des sort on that column. I also have 4 filters that a user can apply to the table. What is supposed to happen.... If a user clicks on a column header twice in a row ( or 100 times in a row) the table will toggle back and forth between an asc/des sort on that column. If a user clicks on a "new" column header, the sort will reset to the initial asc/des value assigned to that column instead of just toggling from the current setting. If a user clicks on a filter, the results will be displayed with the "current" sorting method. What is actually happening.... Everything seems to be working fine except when a user clicks on the same filter link more than once. In that case, the sort toggles between asc /des, which I do not want to happen. PHP Code:
Sorting Table Results
I tried searching Google for some stuff about sorting table results. I want to be able to click the different headers and sort the results by each field. Anyone know some good sites/tutorials?
Problem Sorting By 2 Fields From Table
As part of a rating system on my site, data for the total rating and also the number of votes gets added into a table. I am currently trying to query this table to get the highest rated row of data. This worked fine when I only had "ORDER BY rating DESC LIMIT 1" at the end of my query - It would select the row where the rating was 5 out of 5. I realised that if 2 rows had the same rating, I could not determine which one to select. So i tried changing the code to: "ORDER BY rating, num_votes DESC LIMIT 1". For some reason, this now selects a row where both the rating and num_votes values are 0. Just in case you need to see the entire query, here it is:
Array Sorting Blues....2 Dimensional Array
I have a 2 dimensional array where one col contains a Unix style date and the other contains a filename. I read through a directory to get this info. I can load the array and print it out just fine, but I can't seem to sort it using any of the sort functions! I want to reverse sort them, since they are news stories that I want to display in the correct order by date. When I try to sort I get a "Warning: Cannot compare arrays or objects" message. I have the feeling it's something stupid on my part but can't find any good examples anywhere. Anyone have an idea about this? P.S. I know a database would solve this but sadly it's not an option for me right now...
Advice On Sorting Results (in A Table): Session Variables?
I have a table of query results (from PostgreSQL) that I am displaying using PHP. I would like to give the user the option to sort the results by clicking on one of the various table headings. I know that I can sort them at the time that I query them, but this would require a new database query each time. I am thinking of making the heading a hyperlink similar to the following: <a href=myresultspage.php?sort=price> //this would be the link to sort by the price collumn. I have managed to make a simple sorting function, by putting the results into an array then sorting the array by the appropriate dimension of the array as indicated by the value of $sort. My question is this: If I keep the results in an array, how can I pass the array when the user clicks on the hyperlink that tells which collumn to sort by? Do I need to use session variables? It doesn't seem like I can pass an array as a GET variable.
Sorting An Array
I'm trying to sort a listing of albums alphabetically for LyricsList.com, the problem is that I want the initial 'The' and 'A' in some albums (A Hard Days Night, The Wall) to be ignored. So that the list will look like: Abbey Road Dark Side Of the Moon The Final Cut A Hard Days Night Kill 'em All The Wall ABC order, 'A' and 'The' negated. The info comes from a database, in three calls: // call albums that begin with letter $letter $query = "SELECT * FROM albums WHERE album LIKE '$letter%' ORDER BY album"; $result = mysql_query($query) or die(mysql_error()); // call albums that begin with letter A $query_a = "SELECT * FROM albums WHERE album LIKE 'a' ORDER BY album"; $result_a = mysql_query($query_a) or die(mysql_error()); // call albums that begin with letter T $query_t = "SELECT * FROM albums WHERE album LIKE 't' ORDER BY album"; $result_t = mysql_query($query_t) or die(mysql_error()); So I need to get just the albums from $result_t that begin with 'The ' (easy regex) and from $result_a that begin with 'A ' (easy regex), but puting the three of them in order is proving beyond my skill. Thanks in advance for any advise.
Array Sorting
i have to retrieve some info from tables and then add all the fields together, then list out. 10 records per time, then got 2nd page, 3rd page..so on... my problem is ..i can't get my records to sort(highest point to lowest point), then i decided to use array. PHP Code:
Sorting An Array
I have a performed a fairly simple calculation on a mysql table which has returned a new set of values the only problem I have is that I want to sort them using this new value. PHP Code:
Sorting Array?
I have an array that has 3 keys and I want to sort the array by the values in the key called "key3" so which sort function do I use? array("key1"=>"hey", "key2"=>"hello", "key3"=>"hi")
Sorting A 3d Array
I am trying to sort the display url subarray and it works, however, the other arrays stay in there place which throws the whole thing off. How do I sort by displayurl and make the other sub arrays move with it? PHP Code:
Sorting An Array
im going to loop through 17 thousand mysql entries (each entry has aunique, and incremental, id) then calculate a rating of each entry based on some other information. (between 1 and 5). I then want to sort the data with the highest rated entries at the top of the list? my first plan was to add each calculation into an array, as the array...
Sorting An Array..
i've have the following array: files['name'][1] ['size'][1] ['time'][1] files['name'][2] ['size'][2] ['mtime'][2] ...etc. how do I sort this array according to "time" index? so that, for example, files['name'][0] would give "my_file.txt" that was last created?
Sorting An Array
I've got a small problem. I have an array that looks something like this:$smthin = array ( "character1" => 0, "character2" => 0, "character3" => 0, "character4" => 0, "character5" => 0); I add 1 to the value every little while. Then it may look like this:$smthin = array ( "character1" => 1, "character2" => 6, "character3" => 0, "character4" => 1, "character5" => 2); And at this point I'd like to sort the array to look like following:$smthin = array ( "character2" => 6, "character5" => 2, "character1" => 1, "character4" => 1, "character3" => 0); I don't think sort() function will help me with this. That would ruin the keys.
Sorting Array Of Objects?
I'm reading an XML file using SimpleXML and xpath into an array. What I'd like to do is sort the array based on a specific element's value. For instance, an XML that has some elements like: <CUST> <NAME>ABC Co.</NAME> <LVL>A1</LVL> <STATE>CA</STATE> </CUST> <CUST> <NAME>ACME</NAME> <LVL>A2</LVL> <STATE>CA</STATE> </CUST> is read into an array. Because I'm using SimpleXML, the array elements are each SimpleXML objects. I want to then sort the array based on the value of the LVL element (i.e. A1's, then A2's, etc.). Every item in the array will contain this element. Is this possible?
Sorting A Two Dimensional Array
I have an array, thus: Array ( [0] => Array ( [Freq] => 28 [Name] => Tomato ) [1] => Array ( [Freq] => 4 [Name] => Banana ) [2] => Array ( [Freq] => 54 [Name] => Orange ) [3] => Array ( [Freq] => 24 [Name] => Eggplant ) [4] => Array ( [Freq] => 5 [Name] => Courgette ) [5] => Array ( [Freq] => 4 [Name] => Apple ) ) I would like to be able to sort it either by the Frequency or the Name of the fruit or vegetable. I just can't seem to get it to work. I'm sorry - I realise that this is probably really easy but my brain isn't working today and the examples on php.net seem incomprehensible to me.
Sorting A Multidimensional Array
I Have an array set as so: $temparr[$i]['score'] = 3.4 $temparr[$i]['id'] = 1 $temparr[$i]['title'] = 'title' $i loops the array populating it, but when I output the array, i would like to sort it by the 'score' value asc or desc, depending on what i want to show... what is the easiest way of achieving this?
Sorting 2D Array By Inner Array's Key
What is the most efficient way to do this for a fairly big array? For example: $arr[0][0]='apple'; $arr[0][1]='24'; $arr[1][0]='orange'; $arr[1][1]='2'; $arr[2][0]='banana'; $arr[2][1]='3451'; What would be the best way to sort that array by the inner array's 1 key?
Sorting An Array That Is A Little Messed Up?
I am trying to perform a sort of some data from a mysql database, by DATE. However, the original people who made it (and the entire website) were a little dense, and stored the dates as varchar(15) in the format ddmmyy. I need to retrieve multiple attributes, but sort only by one of the them: con_date. I have a if(sortby==relevance) ... elseif(sortby==age) condition. The relevance sort isn't a problem. It loops through the array and echos out (in relevance order) a headline, text, and the date in a readable format using a function that converts it: .....
Sorting Array By Its First Dimmension
A little question I need to chew on... If I have a 2 dimmensional array, with this structure: array(1, date type name 2, date type name 3, date type name); and I want to sort by the date, how would I go about doing this?
Sorting A Multidimensional Array On Two Columns
I'm working on some low-tech sort of content managing system. It uses textfiles as a kind of database so the users don't have to install SQL on their server. Now I want to perform some sorting on my files. These are the contents of one of those files. PageName;Template;Menu;Sub; Introductie;1;1;1; Opnemen;1;2;0; Voorbereidingen;1;2;2; Kwaliteit;1;1;0; Blabla;1;2;1; I first read this file into $someArray with file() and then I parse each row with explode() into columns. So $someArray[2][2] contains the value 2 and $someArray[0][2] contains "Sub". I want to sort this array on both Menu and Sub and write it back to the file. It should look like this. PageName;Template;Menu;Sub; Kwaliteit;1;1;0; Introductie;1;1;1; Opnemen;1;2;0; Blabla;1;2;1; Voorbereidingen;1;2;2; I want to make a list of menus and their listed submenus in the proper order, as you can see . What is the clever way to do this? At this moment I use a loop that sorts the submenu in a loop that finds the right menu in a loop that sorts the menus. No, it's not you, I don't understand it myself anymore. That's because I don't understand most of the array principles and functions.
Sorting Multi-dimensional Array
Sorting multi-dimensional array I have this array: Array ( [0] => Array ( [account] => 263 [counter] => 1 ) [1] => Array ( [account] => 324 [counter] => 5 ) [2] => Array ( [account] => 972 [counter] => 3 ) [3] => Array ( [account] => 1316 [counter] => 3 ) [4] => Array ( [account] => 1380 [counter] => 1 ) [5] => Array ( [account] => 1880 [counter] => 2 ) ) I need to sort by the key [counter], how can I do that?
Sorting An Associative Array Of Objects By Value?
I'm trying to sort an array of objects within an object. Included is a dumbed down example so that we can get at the meat of the issue without worrying about complexity or validation. Basically, Funk is an object that has a name (string) and a value(int). FunkThis represents an object containing a list of Funks, with each key corresponding to the name of the Funk. I want to sort this list by val, but I get a Warning: usort(): Invalid comparison function error when I run the script. Keep in mind that this is for PHP 4 I'm open to suggestions to getting this to work. <?php class Funk { var $name; var $val; function Funk($name,$val) { $this->name = $name; $this->val = $val; } function getVal() { return $this->val; } function getName() { return $this->name; } } class FunkThis { var $list; function FunkThis() { $this->list = null; } function add($funk) { $this->list[$funk->getName()] = $funk; } function compareFunks($a,$b) { $aVal = $a->getVal(); $bVal = $b->getVal(); if ($aVal == $bVal) return 0; if ($aVal $bVal) return 1; if ($aVal < $bVal) return -1; } function sortByFunk() { $list = $this->list; $this->list = uasort($list,"compareFunks"); } function show() { print_r($this->list); } } $a = new Funk("A",3); $b = new Funk("B",7); $c = new Funk("C",1); $d = new Funk("D",9); $e = new Funk("E",6); $funkthat = new FunkThis(); $funkthat->add($a); $funkthat->add($b); $funkthat->add($c); $funkthat->add($d); $funkthat->add($e); $funkthat->sortByFunk(); $funkthat->show(); ?>
Sorting Multi-dimensional Array
I am having trouble getting the sort function for arrays to work correctly on my multi-dimensional array. array[0][]=Ƈ' array[1][]='bob' array[2][]='age' array[0][]=Ƌ' array[1][]='bill' array[2][]='age' I then do sort($array[0]) But only array[0][] gets sorted, the names do not follow. Does anyone see any error on my part or have a clue for me to follow to solve this?
Sorting And Cleaning Array From 4 DB Fields
I have 4 fields in my database that I am trying to combine and present as a unified dropdown. I've gotten the basic sort and display of the info to work, but don't quite know how to remove spaces caused by empty field nor how to make the dropdown unified. Code:
Multi-dimensional Array Sorting
I need some help sorting an array, same in structure as: Array ( [assoc1] => Array ( [key1] => value [key2] => value [key3] => value ) [assoc2] => Array ( [key1] => value [key2] => value [key3] => value )) What I want to do is sort the array by the value in say the key2 "column". Depending on input, the value to sort by may be key3 or some other key. I've looked at array_multisort(), but I'm not sure how I can specify what exact column I want to sort by, without affecting the rest.
Sorting Paired Array Non Case Sensitively
DOes anybody know how I can sort a paired array of strings using the asort() function non case sensitively. I've tried using the asort($array, SORT_STRING) and SORT _REGULAR sort flags but they aren't working. At the moment, capital letters are taking preference over lower case letters and I need them sorted alphanumerically regardless of case.
Sorting An Multidimentional Array By Multiple Fields
If the multidimentional array was a mysql TABLE, what i'm trying to do would look like this: SELECT * from array WHERE 1 ORDER BY field1 ASC, field2 DESC, field3 ASC and so on. I already constructed a function do to so, but this function, or should i say these 2 functions, sort only the first field properly, and then any other field is sorted improperly. PHP Code:
Array Sorting Differs Depending On PHP Version
I have this test code: <html><pre><? echo "Versión: ".phpversion()." "; $define_list = array( 'PRODUCT_LIST_MODEL' => 0, 'PRODUCT_LIST_NAME' => 0, 'PRODUCT_LIST_MANUFACTURER' => 1, 'PRODUCT_LIST_PRICE' => 0, 'PRODUCT_LIST_QUANTITY' => 1, 'PRODUCT_LIST_WEIGHT' => 1, 'PRODUCT_LIST_IMAGE' => 1, 'PRODUCT_LIST_BUY_NOW' => 1 ); arsort($define_list); echo "*** arsort(): "; print_r($define_list); echo " "; $define_list = array( 'PRODUCT_LIST_MODEL' => 0, 'PRODUCT_LIST_NAME' => 0, 'PRODUCT_LIST_MANUFACTURER' => 1, 'PRODUCT_LIST_PRICE' => 0, 'PRODUCT_LIST_QUANTITY' => 1, 'PRODUCT_LIST_WEIGHT' => 1, 'PRODUCT_LIST_IMAGE' => 1, 'PRODUCT_LIST_BUY_NOW' => 1 ); asort($define_list); echo "*** asort(): "; print_r($define_list); echo " ";
Sorting An Array Based On One Of Many Form Fields?
I think the root of my problem, aside from mental, is array based...but I'm not even sure what I want to do is even possible. So if I can get far enough to know that one way or the other, then I can try to figure out how to do it. But here's the situation: Page 1 I have a form with many item rows pulled from a database query. Among other fields, each row contains a checkbox to select the item and a text field which contains an item_description. On submit, I have it so that every checked item goes onto the next page where more stuff happens to each item, and the select items end up in an HTML table as well as a CSV spreadsheet. Now, because the selected items are pulled from an array based on the checkbox, the sort order is based on the item's unique ID number. WHat I'm being asked is if I can have the final results sorted by that item_description field I mentioned before. Which can occurr at the end of the 2nd page's processing, sure. Well, here's what I have to select the items: .....
Sorting An Array With Another Array
I have an array that is an order of things: array(23,54,1,45,12,9) And then I have an array of values from the table. Within this array is an id which relates to the previous array. It holds quite alot of information so I'm hoping there might be an easy way, as opposed to the long and messy way, to sort this array with the values in the other array. Looking through the array functions, I can't quite see it. Any advice on this one?
Grab Content From HTML Table And Place Into MySQL Table?
I am in the process of helping a co-worker upgrade some of his old static html pages into dynamic MySQL driven pages. He currently has a lot of pages with huge tables displaying data. Does anyone know if there is a script or class that can convert a table to a .sql file for upload?
Table Background Color Based On Results From MySQL Table
I am trying to get the "Did User Agree" field on a database query to be colored Green for "Agreed" Red for "Disagreed" and Blue for "Agreed (2nd Time)" .. I have my PHP setup to do the query just fine as of right now with alternating column colors, just can't seem to get the colors to work as I am hoping for. Can anyone help me get the Agreed? table's background color to the colors above? Code:
Mysql Fetch_field Gets Table Alias, Not Real Table Name
After a SQL 'select .... from tablename alias' the mysql_fetch_field function returns a value $result=>table which will contain the alias, not the actual table name. Is there a way to get the actual table name ? I am running mysql 4.1 and php 4.4
Using PHP To Sort Data In MySQL Table 1 By Values In Table 2
I have a MySQL database with 2 tables in it. products and prices.. Products has a field in it called 'prodno'. Prices has a field in it called 'prodid'. There is one of each item in products and each product has it's own unique 'prodno' There are multiple instances of each product's pricing in prices.. One for each price.. So if a product had multiple prices depending on quantity it would have an entry for each price.. Example: id = 1 prodid = 7001 qty = 300 price = 12.5 id = 2 prodid = 7001 qty = 400 price = 15.5 I was wondering if I could query the database getting info from the products table but sort it according to the prices in the prices table. Kinda like doing a "SELECT * FROM products" ordering it by the lowest price value from each item.. This is all very confusing to me, and I'm the one writing it. Let's try one last time.. Query the database selecting * from products (I plan on using all the info in products) and ordering them by the lowest price for each item in the prices table. I've tried sorting the results of just a basic SELECT * FROM products using Javascript and PHP but with pagination in the results it makes it a bit hard.
MySQL Sorting
I'd like to do is divide results from a MySQL query over multiple pages, each holding a certain number of results. Now I have a PHP script that uses the MySQL command LIMIT in the query to get # results at a time (which also means not all the results are returned every time, just a few, obviously this is a good thing for speed/load so I wanna keep it that way). The MySQL manual states that if you use LIMIT # with ORDER BY, MySQL will end the sorting as soon as it has found the first # lines Ok I could've posted this on the MySQL forum first but actually I was wondering whether someone has a solution in PHP for this?
PHP/MySql Sorting Difficulties
I have written a sorting engine which displays non expired records, but im having difficulties getting it to work. It was working fine until I added pagination, and now it seems to have gone to pot. The script works by getting todays date, and based on the users selection from the drop down menu, calculates the number of pages, and records the users sort preference. The correct number of links to different pages are then generated, and the pages are populated based on the users sort preference, or so I thought... The first page of results is sorted correctly, but on the second and subsequent pages, this isnt always the case. This causes results to be appearing in the wrong order, or not at all in some cases. Ive included my source code, if anyone see's anything which is glaringly obvious, or feels like giving me a hand fixing this id very much appreciate it :) <!-- This is the HTML Form where the user selects if they wish to sort or search for records --> .......
MySQL (DB) Result Sorting
I'm doing is taking results (fetching rows) from my mySQL database. But what I want to do is sort the results according to last name. So basically the table structure looks something like this: id (primary key) fullname A example rows could be: 1 John Smith 2 Mary Jane Now what I want to do is sort the results in PHP based on last name. I'm using the Pear DB for connecting to my mySQL database. Based on the example rows I gave, Mary Jane would go first, and then John Smith. How would I go about doing this? I was beginning to split the result based on spaces, and the last word to explode, but how would I truly do this?
|