yuso6363 Posted October 7, 2010 Share Posted October 7, 2010 I am trying to get more than one row from a database at once, then explode each value into a seperate variable. is there a way of doing this? Quote Link to comment Share on other sites More sharing options...
chintansshah Posted October 7, 2010 Share Posted October 7, 2010 If I understand you properly then you can implement like this $query = mysql_query("SELECT * FROM table_name"); while($row = mysql_fetch_array($query)) { // you can apply explode here on each row data like name and school $name_arr = explode("-",$row["name"]); $school_arr = explode("-",$row["school"]); } I hope above code helps you. Quote Link to comment Share on other sites More sharing options...
phpchamps Posted October 7, 2010 Share Posted October 7, 2010 your question is not at all clear.. and solution suggested by Mr. Chintan not gonna help you.. Please post your clear requirement.... Quote Link to comment Share on other sites More sharing options...
yuso6363 Posted October 7, 2010 Author Share Posted October 7, 2010 My site is a virtual pet website and I am trying to add a pet breeding page. I need it to get every pet that has the persons user id on it then show a link to the person to choose a male pet from the list and a female pet from the list. I can't get it to fetch more than one pet at once 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.