Well i am trying to do somthing a bit complicated to explain so i'll do my best...
I have a mysql table where the ammount of fields can vary and i will not know the name of them. I wanted to add the field name and the content into an array (example below)
+---------------+-----------------+----+----+---+----+
| Username | Email | A | B | C | D | <=== field titles
+---------------+-----------------+----+----+---+----+
| Phil | [email protected] | w | x | y | z | <====example record
+---------------+-----------------+-----+---+---+-----+
becomes
$profile = array (
"username" => "Phil",
"email" => "[email protected]",
"a" => "w",
"b" => "x",
"c" => "y",
"d" => "z"
);
i on there is going to be either a while or a foreach loop involved and i know the array would look different cause you would need some code in there, its just a representation of how the data would end up inputted in the array.
hope its clear enough to understand!
-Phil
Thanks guys for the help!
Live connector thanks for the code worked perfectly!
I have a mysql table where the ammount of fields can vary and i will not know the name of them. I wanted to add the field name and the content into an array (example below)
+---------------+-----------------+----+----+---+----+
| Username | Email | A | B | C | D | <=== field titles
+---------------+-----------------+----+----+---+----+
| Phil | [email protected] | w | x | y | z | <====example record
+---------------+-----------------+-----+---+---+-----+
becomes
$profile = array (
"username" => "Phil",
"email" => "[email protected]",
"a" => "w",
"b" => "x",
"c" => "y",
"d" => "z"
);
i on there is going to be either a while or a foreach loop involved and i know the array would look different cause you would need some code in there, its just a representation of how the data would end up inputted in the array.
hope its clear enough to understand!
-Phil
Thanks guys for the help!
Live connector thanks for the code worked perfectly!