mindstorm Posted September 20, 2008 Share Posted September 20, 2008 hi there, i am struggeling with my array. when i echo it i only recieve the word 'Array' on the screen i have an example here http://www.deakin.edu.au/~pr200808/prototype/news.php This array has been retrieved from an qracle database and has three fields N_ID N_DATE N_NEWS so the array only has the there fields. how do i go about seperating these three fields into seperate variables to that they can be displayed by them selves? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/125078-solved-seperating-an-array-retireved-from-a-database/ Share on other sites More sharing options...
JasonLewis Posted September 20, 2008 Share Posted September 20, 2008 Try using print_r() instead of echo. echo "<pre>", print_r($your_array), "</pre>"; To access the elements, you need to do it like so: echo $your_array['N_DATE']; Quote Link to comment https://forums.phpfreaks.com/topic/125078-solved-seperating-an-array-retireved-from-a-database/#findComment-646419 Share on other sites More sharing options...
mindstorm Posted September 21, 2008 Author Share Posted September 21, 2008 thanks, the first part worked brilliantly, second part was not quite right, it needed to be echo $dbResult [0] ['N_ID']; but still thanks. would not have worked it out if it weren't for this help. cheers Quote Link to comment https://forums.phpfreaks.com/topic/125078-solved-seperating-an-array-retireved-from-a-database/#findComment-646760 Share on other sites More sharing options...
Adam Posted September 21, 2008 Share Posted September 21, 2008 Never really worked with oracle before so can't say a great deal.. but if you show a little more code just sorta how you retrieve the array from the db, might be able to help you bit more.. Adam Quote Link to comment https://forums.phpfreaks.com/topic/125078-solved-seperating-an-array-retireved-from-a-database/#findComment-646762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.