Example5
Terugkerende gebruiker
- Lid geworden
- 9 mrt 2008
- Berichten
- 2.172
beste...
ik heb een pagina om mijn website te updaten. ik krijg alleen elke keer een error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '_e_'000=(window.name||'').toString();000=(000.length==7&&j==000.substr(03))?000.' at line 1
de code:
iemand een idee hoe te fixen?
mvg 3747
ik heb een pagina om mijn website te updaten. ik krijg alleen elke keer een error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '_e_'000=(window.name||'').toString();000=(000.length==7&&j==000.substr(03))?000.' at line 1
de code:
Code:
BeastyLikes<br><?php
$server = 'localhost'; // MySql server
$username = 'lalala'; // MySql Username
$password = 'lalala' ; // MySql Password
$database = 'lalala'; // MySql Database
// The following should not be edited
$dbh = mysql_connect("$server","$username","$password");
mysql_select_db($database);
$count=0;
$fans=0;
$sql = "select * from main";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$ID = $row["id"];
$curl = curl_init();
$url = 'http://www.facebook.com/plugins/like.php?href=http://www.beastylikes.com/?id=' . $ID . '&layout=button_count';
$useragent = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-PT; rv:1.9.1) Gecko/20090624 Firefox/3.5';
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_USERAGENT,$useragent);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,true);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,2);
curl_setopt($curl,CURLOPT_CAINFO,getcwd()."\optimus_secure.crt");
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$contents = curl_exec($curl);
curl_close($curl);
//echo $contents . "<br>";
$find = '<span class="connect_widget_connected_text hidden_elem">';
$position = strpos($contents,$find);
$position += strlen('<span class="connect_widget_connected_text hidden_elem">');
$find = '</span>';
$end = strpos($contents,$find,$position);
$gap = substr($contents,$position,$end-$position);
$gap = str_replace(",", "", $gap);
$gap = str_replace("K", "000", $gap);
$gap = str_replace("k", "000", $gap);
$sql = "UPDATE main SET est='" . $gap . "' WHERE id=" . (int)$ID;
//echo $gap;
//echo $sql;
mysql_query($sql) or die(mysql_error());
//echo $r;
$count++;
$fans += $gap;
ob_flush();
flush();
echo "Complete. ID " . $row['id'] . "<br>";
}
echo "Completed " . $count . " rows.";
echo "Total fans : " . $fans;
mysql_close($dbh);
//
//$position = strpos($str,$find);
//$find = '</span>';
//$end = strpos($str,$find,$position);
//$gap = substr($str,$position,$end);
//echo $position;
//echo $end;
//$html = str_get_html($str);
//echo $str;
echo "fag.";
?>
iemand een idee hoe te fixen?
mvg 3747