I added test lines to get an idea where in the code it stops, and the online printed line I get is "connected".
Any thoughts on what the problem could be?
Code:
<?php
// Connect to the MySQL database
$conn = mysql_connect("localhost", "root", "XXXXX");
// Select the database
$db = mysql_select_db("royalities");
// Query the table
$query = "SELECT * FROM roster";
$result = mysql_query($query) or die(mysql_error());
echo "connected";
// Loop through each row, submit HTTP request, output coordinates
while (list($cname, $url) = mysql_fetch_row($result))
{
echo "in while loop";
$url = "PM for the $URL";
// Retrieve the URL contents
$page = file_get_contents($url);
echo "getting url contents";
// Parse the returned XML file
$xml = new SimpleXMLElement($page);
echo "getting xml";
// Parse the coordinate string
list($cname) = $xml->guildKey->guildInfo->guild->members->character[7]->attributes();
list($url) = $xml->guildKey->guildInfo->guild->members->character[11]->attributes();
echo "parsing";
$charsheeturl = "PM for CHAR SHEET URL";
// Output to table
//$query2 = "UPDATE roster SET name = '$cname', url = '$url' WHERE id = '$id'";
$InsertQuery = "INSERT INTO roster (name, url) VALUES ('$name', '$url')";
echo "insert query $InsertQuery";
$RunInsertQuery = mysql_query($InsertQuery) or die(mysql_error(error));
echo "run query";
// Output to Screen
echo "Name: $cname";
echo "URL: $charsheeturl$url";
}
?>


Sign In
Create Account

Back to top









