lexington
12-17-2008, 06:07 PM
Simple php array question please
Hello, how can I insert the result of a query into an array so that it appears like the following quoted example if you print_r the info on a page?
Quote:
Array ( [0] => [1] => blah 1 [2] => blah 2 [3] => blah 3 [4] etc...
There is a script that explodes one string into seperate parts and I am replacing that with separate database entries. I would like to insert each row into an array so I do not have to do such a serious rewrite of the script if all of the results are in an array already. I used:
Quote:
print_r(array($item_row['item_name']));
However it only displays one result and not all of the rows:
Quote:
Array ( [0] => blah 1 )
I know that it is possible since a year ago someone did this for me. Thanks!
Last edited by lexington : 12-17-2008 at 05:11 PM.
Hello, how can I insert the result of a query into an array so that it appears like the following quoted example if you print_r the info on a page?
Quote:
Array ( [0] => [1] => blah 1 [2] => blah 2 [3] => blah 3 [4] etc...
There is a script that explodes one string into seperate parts and I am replacing that with separate database entries. I would like to insert each row into an array so I do not have to do such a serious rewrite of the script if all of the results are in an array already. I used:
Quote:
print_r(array($item_row['item_name']));
However it only displays one result and not all of the rows:
Quote:
Array ( [0] => blah 1 )
I know that it is possible since a year ago someone did this for me. Thanks!
Last edited by lexington : 12-17-2008 at 05:11 PM.
