how to put data from database directly to array? for example i will get a data from my database like this "a,b,c,d" is there a way of putting the data in the array without looping? because what i did is i use substr() function and one by one i put it to array and the " , " is my sign that the data should be put to array.
output
=>a for $array[0]
=>b for $array[1]
=>c for $array[2]
=>d for $array[3]
if there any other way to do this that will make the program more faster, because my program is more on parsings. pls share your knowledge. thanks in advance...
thanks for reply.. yes im using mysql and that how i also query my data from database.. what i mean is.. for example the data in my data base is like this " a,b,c,d " and that data is only in one field or line of database and when i get that data from database it should directly put or store in array.. print_r is just like print right? and when i get have it in array that data can be use many times inside the program...
Then you can see the content of the array using print_r again - it just allows you to look at the content of the array (for debugging really) and then you can access it like $array[0], $array[1] etc.
Is this making sense to you?
Last edited by smickus; 12-30-2007 at 11:32 AM.
Reason: error in code!
yeah.. thats what i want.. thank you very much smickus.. this is just a simply function but its really help me a lot and work my system fast... thanks again...
Bookmarks