Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Php / MySQL update script sending empty response
#1
Hello.

I run and manage a small website for my guild / alliance, in which I have an automated rank / level retrieval script.
A couple months back, I made a quick script in PHP that takes values from a webpage, and inserts them into an SQL database. The script worked for a while, until recently when my web host upgraded to a new server. Now the script always gives me "(52) Empty reply from server" (using curl).

My knowledge on fixing these sorts of things is fairly limited, so I was hoping there was a few others around here that could help me out.

My script:

Code:
error_reporting(E_ALL | E_STRICT);
$max_execution_time = ini_get( 'max_execution_time' );
require("updatef.php");
mysql_connect("localhost","myusername","mypassword") or die(mysql_error());
mysql_select_db("hlallian_rank") or die(mysql_error());
//After Connection
$result1 = mysql_query("SELECT name, rank FROM guild") or die(mysql_error());
while ($row1 = mysql_fetch_array($result1, MYSQL_ASSOC))
    {
    $char = $row1['name'];
    // echo "<br/>updating $char";
    $searchStatus = getCharData($char, $charData);
    $exppercent = sprintf('<br>%.2F', $charData['expPercent']).'%';
    mysql_query("UPDATE guild SET class='{$charData['jobImageURL']}', avatar='{$charData['characterImageURL']}', pet='{$charData['petImageURL']}', level='{$charData['level']}', exp='{$charData['experience']}', percent='{$exppercent}', rank='{$charData['rank']}' WHERE name='{$char}'")or die(mysql_error());
    set_time_limit( $max_execution_time );
    }

Updatef.php contains the functions that fetches the data from the website, using regular expressions and preg_match.
Reply


Messages In This Thread
Php / MySQL update script sending empty response - by Toastyc12 - 2011-02-23, 12:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)