Jump to content
xisto Community
Sign in to follow this  
it01y2

Explode Function Help need help from you programmers

Recommended Posts

:lol: Hi I am robert I need some help with some php coding. I am stuck with a explode function.Here is the code:$username = $check[uname];$query="SELECT `buildings` FROM `authuser` WHERE `uname` = '$username'";$result=mysql_query($query);$result=mysql_result($result,0);list($building1,$building2,$building3,$building4,$building5,$building6,$building7,$building8,$building9,$building10,)=explode('|',$result,'|',$position);I want to explode a mysql field into two seperate fields so egbuilding then position, building then position etc...I want to create a variable for the building then the position eg $building1 then $postion1 then $building2 then $building2 etc...Any ideas?

Share this post


Link to post
Share on other sites

What does the data for $buildings look like?

Please post a sample for us to review. The explode() needs a unique character or set of characters to use as a delimiter.

PHP reference for the function is here: explode ()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.