|
||||
|
I'm trying to output sessions "row 0" "row 1" etc and all I get is either a blank output or "Array"
This was working before I put the loop in. I think there's a problem with ['row '.$i] I've tried $row = "row "; $row = $row.$i - but that doesn't work either. Can anyone see where i'm going wrong? The php is - $query = " SELECT * FROM table ORDER BY RAND() LIMIT 1 "; for($i = 0; $i <= 2; $i++) { if($result = mysql_query($query)) { while( $output = mysql_fetch_row($result) ) { // create name and output to session $_SESSION ['row '.$i] = $output; } mysql_free_result($result); } } the output page is echo $_SESSION['row 0']; echo ' <br>'; echo $_SESSION['row 1']; echo ' <br>'; echo $_SESSION['row 2']; echo ' <br>'; I can't think of any other way of creating row 0, row 1 in the loop. Thanks in advance. Steve. |
![]() |
| Bookmarks |
| Webmaster Resources |
| • UK Web Hosting • UK WW SEO Tools • Free site submission • Web Directory |
| Advertisement |
![]() |
| Site Of the Month |
![]() Nominate site of the month |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If you ever had this problem... | OldDarkstarAccount | General Webmaster Talk | 8 | 11-06-2007 08:43 AM |
| problem with Sessions | StevieB | General Webmaster Talk | 2 | 09-21-2007 04:35 PM |
| little problem | Bisje | Feedback (Don't holdback :) | 6 | 09-20-2007 12:40 PM |
| Problem! | smartu | iG Shop | 0 | 01-14-2004 05:41 AM |
| Problem | Funnydummy | iG Shop | 0 | 11-04-2003 12:10 PM |
| UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons. |
| Subscribe to our feeds |