Jump to content

Problem to show "players_xml" in a php web


Sylvert

Recommended Posts

You need to use PHP's xml functions to parse the contents and read the player values.

 

I try to do the following:

 


if( mysql_num_rows( $r ) )
 if( $m = mysql_fetch_array( $r ) )
      $xml = $m['players_xml']

foreach( $xml as $item )
{
  echo( 'Name: '. $item->name );
}

 

It does not work, get the following error

 

Warning: Invalid argument supplied for foreach() in servers.php on line 52

Edited by Sylvert
Link to comment
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
×
×
  • Create New...

Important Information

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. Terms of Use