Nobbie wrote:SQL Tables do not have any fields order.
The order of the selected fields depends on the Select Statement
SELECT abc, xyz, blabla, blubblubb FROM table ....
So if you like to have a certain order in your fetched rows, simply adapt the Select statements to your needs.
What I'm doing is creating a .pdf document (a questionnaire) from two tables, one containing the text and the other containing the variables. The reason I wanted to have the fields in order is so that I could simply retrieve the data as arrays and, in effect, merge them using a "for" loop. I wanted to use the "SELECT *..." because there are 45 fields, and that would require a lot of typing (admittedly only once), when only about a half dozen of the fields in the variables table are not in the same order as the text table.
From what I've seen in the references you've provided as well as the MySQL Query Browser, all are basically addressing methods for sorting the rows. I'm only dealing with one row at any givend time (i.e. The user fills out the questionnaire and, upon submission, the answers are stored in a MySQL Table for future follow up, but then those same data from the two pages of the questionnaire are then merged into a .pdf [using FPDF] and sent as an email attachment, to another agency which processes the data.
I guess, if there's no way to physically rearrange those half dozen or so fields in the table, perhaps I can find another approach, such as using the questionnaire variables array which, is in the correct sequence, and at the time, is in a session variable. It's an associative array, however, and I don't know if it's allowable to loop through that kind of array referencing the elements by numeric position.
Please tell me that it can be done?!?!?!?