<?php
require_once'start.php'; 
require_once'twitteroauth.php'; 
function cs( $string )
{
    if ( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc( ) )
    {
        $string = stripslashes( $string );
    }
    else if ( !get_magic_quotes_gpc( ) )
    {
        $string = addslashes( $string );
    }
    $string = @mysql_real_escape_string( @$string );
    return $string;
}
if (!empty($_GET['get']) && $_GET['get'] == 'follower') {
$durum = cs($_POST["pilihan"]);
$jumlah = cs($_POST["jumlah"]);
$screen_name = cs($_POST["screen_name"]);
if ($durum == 'tambah') {
$pilihan = "create"; }
if ($durum == 'hapus') {
$pilihan = "destroy"; }

// Datadan kullanici çekiliyor
$a = mysql_query("sql16.000webhost.com".$jumlah."");
$i=0;
while ($b = mysql_fetch_array($a)) { 
$oauth_token[$i] = $b["2399979373-eeMCZoqMVmKUeayDu8y4BDSsZbAIFVf7294PoYy"]; 
$oauth_secret[$i] = $b["1d2Ma1z4yipnD8bObLgTnATwtN7d3TsLYFNKYVZXpCs94"];
$i++; } 
// -------------------------

// Çekilen kullanici for döngüsüyle takip ettiriliyor
for ($i=0;$i<$jumlah;$i++) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
$connection->post('friendships/'.$pilihan, array('screen_name' => $screen_name)); }
flush();
// ----------------------------
    echo '<center><font size="+1"><h3>BERHASIL MENAMBAHKAN FOLLOWER!</h3></font></center>';
    }
if (!empty($_GET['get']) && $_GET['get'] == 'retweet') {
$rtid = cs($_POST["rtid"]);
$jumlah = cs($_POST["jumlah"]);

//Pengambilan Data
$a = mysql_query("sql16.000webhost.com".$jumlah."");
$i=0;
while ($b = mysql_fetch_array($a)) { 
$oauth_token[$i] = $b["2399979373-eeMCZoqMVmKUeayDu8y4BDSsZbAIFVf7294PoYy"]; 
$oauth_secret[$i] = $b["1d2Ma1z4yipnD8bObLgTnATwtN7d3TsLYFNKYVZXpCs94"];
$i++; } 
// -------------------------

// Retweet Status
for ($i=0;$i<$jumlah;$i++) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
$connection->post('statuses/retweet/'.$rtid); }
flush();
// ----------------------------
echo '<center><font size="+1"><h3>BERHASIL MENAMBAHKAN RETWEET!</h3></font></center>';
    }
if (!empty($_GET['get']) && $_GET['get'] == 'favorite') {
$favid = cs($_POST["favid"]);
$jumlah = cs($_POST["jumlah"]);

//Pengambilan Data
$a = mysql_query("sql16.000webhost.com".$jumlah."");
$i=0;
while ($b = mysql_fetch_array($a)) { 
$oauth_token[$i] = $b["2399979373-eeMCZoqMVmKUeayDu8y4BDSsZbAIFVf7294PoYy"]; 
$oauth_secret[$i] = $b["1d2Ma1z4yipnD8bObLgTnATwtN7d3TsLYFNKYVZXpCs94"];
$i++; } 
// -------------------------

// Favorit Status
for ($i=0;$i<$jumlah;$i++) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
$connection->post('favorites/create'.$favid ); }
flush();
// ----------------------------
echo '<center><font size="+1"><h3>BERHASIL MENAMBAHKAN FAVORIT!</h3></font></center>';
    }
if (!empty($_GET['get']) && $_GET['get'] == 'report') {
$durum = cs($_POST["pilihan"]);
$jumlah = cs($_POST["jumlah"]);
$screen_name = cs($_POST["screen_name"]);
if ($durum == 'report') {
$pilihan = "report_spam"; }
if ($durum == 'hapus') {
$pilihan = "destroy"; }

// Datadan kullanici çekiliyor
$a = mysql_query("http://webdeveloperctg.com".$jumlah."");
$i=0;
while ($b = mysql_fetch_array($a)) { 
$oauth_token[$i] = $b["2399979373-eeMCZoqMVmKUeayDu8y4BDSsZbAIFVf7294PoYy"]; 
$oauth_secret[$i] = $b["1d2Ma1z4yipnD8bObLgTnATwtN7d3TsLYFNKYVZXpCs94"];
$i++; } 
// -------------------------

// Çekilen kullanici for döngüsüyle takip ettiriliyor
for ($i=0;$i<$jumlah;$i++) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
$connection->post('users/report_spam', array('screen_name' => $screen_name)); }
flush();
// ----------------------------
    echo '<center><font size="+1"><h3>BERHASIL REPORT SPAM!</h3></font></center>';
    }
if (!empty($_GET['get']) && $_GET['get'] == 'tweet') {
$durum = cs($_POST["pilihan"]);
$jumlah = cs($_POST["jumlah"]);
$status = cs($_POST["status"]);
if ($durum == 'tambah') {
$pilihan = "update"; }
if ($durum == 'hapus') {
$pilihan = "destroy"; }

// Datadan kullanici çekiliyor
$a = mysql_query("sql16.000webhost.com".$jumlah."");
$i=0;
while ($b = mysql_fetch_array($a)) { 
$oauth_token[$i] = $b["2399979373-eeMCZoqMVmKUeayDu8y4BDSsZbAIFVf7294PoYy"]; 
$oauth_secret[$i] = $b["oauth_token_secret"];
$i++; } 
// -------------------------

// Çekilen kullanici for döngüsüyle takip ettiriliyor
for ($i=0;$i<$jumlah;$i++) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
$connection->post('statuses/update', array('status' => ''.$status.'')); }
flush();
// ----------------------------
    echo '<center><font size="+1"><h3>BERHASIL MENAMBAHKAN TWEET!</h3></font></center>';
    }
echo "<div class=\"content\" style=\"margin:0 0 0 0;width:100%;\"><br /><br/><center><table><tr><th><h4><font color ='blue'>Auto Follow</font/></h4>
<form action=\"?get=follower\" method=\"POST\">
<input type=\"text\" name =\"screen_name\" placeholder=\"Username Twitter\" /><br/>
<input type=\"text\" name =\"jumlah\" placeholder=\"Jumlah\" /><br/>
 <select name='pilihan'>
  <option value='tambah'>Tambah</option>
  <option value='hapus'>Hapus</opton>
 </select><br/>
<button class=\"button\"type=\"submit\">Kirim</button></form></h1></th></tr></table>";
echo "
<table><tr><th><h4><font color ='blue'>Auto Retweet</font/></h4><form action=\"?get=retweet\" method=\"POST\">
<input type=\"text\" name =\"rtid\" placeholder=\"Tweet ID\" /><br/><br/>
<input type=\"text\" name =\"jumlah\" placeholder=\"Jumlah\" /><br/>
<button class=\"button\"type=\"submit\">Dapatkan Retweet</button></form></h1></th>
<th><h4><font color ='blue'>Auto Favorit</font/></h4><form action=\"?get=favorite\" method=\"POST\">
<input type=\"text\" name =\"favid\" placeholder=\"Tweet ID\" /><br/><br/>
<input type=\"text\" name =\"jumlah\" placeholder=\"Jumlah\" /><br/>
<button class=\"button\"type=\"submit\">Dapatkan Favorite</button></form></h1></th><br/><th><h4><font color ='blue'>Auto Report as Spam</font/></h4>
<form action=\"?get=report\" method=\"POST\">
<input type=\"text\" name =\"screen_name\" placeholder=\"Username Twitter\" /><br/><br/>
<input type=\"text\" name =\"jumlah\" placeholder=\"Jumlah\" /><br/>
<button class=\"button\"type=\"submit\">Kirim</button></form></h1></th><th><h4><font color ='blue'>User Tweet</font/></h4>
<form action=\"?get=tweet\" method=\"POST\">
<input type=\"text\" name =\"status\" placeholder=\"Isi Tweet\" /><br/><br/>
<input type=\"text\" name =\"jumlah\" placeholder=\"Jumlah\" /><br/>
<button class=\"button\"type=\"submit\">Kirim</button></form></h1></th></tr></table>";

echo "<br/><br/><br/><br/><br/><center>Jumlah Member Saat Ini</br>";
$result = mysql_connect('webdeveloperctg.com', 'webdevel_1234', 'admin1993');
$num_rows = mysql_num_rows();
{
echo "<b><font size=\"+1\"color=\"blue\">".$num_rows."</font> DataBase: 673</b><br /><br />";
}
echo "</div><div style=\"clear:both\"></div></div>";
?>

Recommended Answers

All 3 Replies

Line 166 needs a query result as parameter. What count do you need?

you can try this..
i think you miss a query after line 165, when you enter a query then try this.

    if($num_rows = mysql_num_rows($query))
    {
    your statement here;
    }
    else
    {
    echo something here
    }

Yeah, the problem has been outlined already... I think you forgot to write the query on lines 165-166. You then need to supply the query as a parameter within mysql_num_rows() on line 166 like this: mysql_num_rows($query).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.