Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Php / MySQL update script sending empty response

- - - - -

  • Please log in to reply
No replies to this topic

#1
M_win

M_win

    Junior

  • Member
  • Pip
  • 68 posts
  • Joined 31-May 05
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.


How to remove advertisement from MSFN



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users