MSFN Forum: Php / MySQL update script sending empty response - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Php / MySQL update script sending empty response Rate Topic: -----

#1 User is offline   M_win 

  • Junior
  • Pip
  • Group: Members
  • Posts: 68
  • Joined: 31-May 05

Posted 22 February 2011 - 10:23 PM

Hello.

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 came here looking for any help or suggestions someone might be willing to offer. Thanks!

My script:

error_reporting(E_ALL | E_STRICT);
$max_execution_time = ini_get( 'max_execution_time' );
require("updatesig.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 group") 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 group 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 );
	} 


Updatesig.php contains the code that fetches the data from the website, using regular expressions and preg_match.


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy