Joshua F Posted May 6, 2010 Share Posted May 6, 2010 How would I make the following code be able to be used more then once, so I can make it post more then just sitename? $result = mysql_query("SELECT sitename FROM sitelist WHERE id=". $_SESSION['id']) or die(mysql_error()); list($sitename) = mysql_fetch_row($result); Example: I have it so when the user is logged in, and they go to the UserCP, they can see there Site Name, but I can't make it say more then Site Name without getting an error. Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted May 6, 2010 Share Posted May 6, 2010 $result = mysql_query("SELECT sitename FROM sitelist WHERE id=". $_SESSION['id']) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $sitename[] = $row['sitename']; } Each of the site names will then be in an array in the $sitename variable Quote Link to comment Share on other sites More sharing options...
Joshua F Posted May 6, 2010 Author Share Posted May 6, 2010 Thsnks, but I figured it out befor you posted. But Thanks anyways =] Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted May 6, 2010 Share Posted May 6, 2010 hehe no problem Quote Link to comment 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.