• hi guys,
    i encountered some problems after including site stats on my blog. below is the following error warning.
    i just don’t know how to solve this one. i need your help, please.
    here is the error warning:
    Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/www/htdocs/barkada-network.com/diary/wp-includes/wp-db.php on line 134
    many thanks in advance.
    michiko

Viewing 7 replies - 1 through 7 (of 7 total)
  • What version of wp ?
    Which ‘site stats’ did you upload ?

    Thread Starter michiko

    (@michiko)

    I’m using version 1.2 and the site stats I uploaded is called “countersolution”. It has only one file and that is the one I included on my blog.
    Here is the code of above mentioned site stats:
    <?php
    //#######Copyright#########################
    //#Das Copyright auf den gesamten #
    //#script liegt bei #
    //#[email protected] #
    //#Dieses Script darf nicht weiterverkauft#
    //#werden, ?¤nderung brauchen meine geneh- #
    //#migung!!!www.script-solution.de #
    //#########################################
    //########################################
    //#Bitte hier die Einstellungen vornehmen#
    //########################################
    $hoster=”localhost”; //dein host standard ist localhost
    $login=”DWXX231″; //dein mysqllogin
    $passw=”password”; //dein passwort
    $datenb=”DWXX231″; //datenbank ausw?¤hlen
    //##########Ende der ??nderungen!##########
    $link=mysql_connect($hoster, $login, $passw)or die (“konnte Keine
    Verbindung herstellen!”);
    mysql_select_db($datenb,$link) or die
    (“Datenbank nicht vorhanden!”);
    //######Hier bitte Farb-und Texteinstellungen vornehmen!######
    $f_color=”#73665B”; //die schriftfarbe
    $f_size=”1″; //die schrifgr????e
    $f_face=”verdana”; //die Schriftart
    $f_besucher=”Visitors:”; //besucher gesamt
    $f_today=”Today:”; //Besucher heute gesamt
    $f_zugriff=”Last Access:<br>”; //Letzter zugriff
    $f_maxonline=”Max. user online:”; //Gleichzeitig user online max.
    $f_besucheronline=”User online”; //wie viele besucher online
    $f_deltime=”86400″;//wie lange soll die ip-sperre bestehen bleiben in sek.
    ##########Ab hier nichts mehr ?¤ndern!!!###################
    ####Datenbank entleeren#############
    $zeit = time();
    $datum = date(“d.m.Y”);
    $loeschzeit= $zeit-$f_deltime;
    $haha=mysql_query(“DELETE FROM csip_list WHERE del<$loeschzeit”,$link);
    ####################################
    $ip=$REMOTE_ADDR;
    $queryone=mysql_query(“SELECT * FROM csip_list where ip=’$ip'”, $link);
    $querytwo=mysql_num_rows($queryone);
    if($querytwo == “0”)
    {
    $order=mysql_query(“UPDATE cshits SET hits=hits+1”, $link);
    $order2=mysql_query(“Select login, lastlogin from cshits”, $link);
    $fetchit=mysql_fetch_array($order2);
    $nocf=mysql_query(“Update cshits SET lastlogin=’$fetchit[login]'”, $link);
    $queryt=mysql_query(“Update cshits SET login=’$zeit'”, $link);
    $hehe=mysql_query(“INSERT INTO csip_list (dates, del, ip) VALUES (‘$datum’, ‘$zeit’, ‘$ip’)”, $link);
    }
    ########Ausgabe kann beginnen###############
    $ausgabe=mysql_query(“SELECT * FROM cshits”, $link);
    $holit=mysql_fetch_array($ausgabe);
    print “<font color=\”$f_color\” size=\”$f_size\” face=\”$f_face\”>$f_besucher $holit[hits]</font><br>”;
    $daftpunk =@mysql_query(“SELECT count(ip) FROM csip_list where dates=’$datum'”, $link);
    $dumdidum = mysql_result($daftpunk, 0);
    print “<font color=\”$f_color\” size=\”$f_size\” face=\”$f_face\”>$f_today $dumdidum </font><br>”;
    print “<font color=\”$f_color\” size=\”$f_size\” face=\”$f_face\”>$f_zugriff”;
    $tdate=date(“d.m”, $holit[lastlogin]);
    $hdate=date(“d.m”);
    if ($tdate == “$hdate” )
    {
    $kzeit= date(“G.i”, $holit[lastlogin]);
    print “Today at $kzeit</font><br>\n”;
    }
    else {
    $vzeit=date(“d.m \u\m G.i”, $holit[lastlogin]);
    print “Am $vzeit</font><br>”;
    }
    $hostering= gethostbyaddr($ip);
    $deleteuser= mysql_query( “delete from cs_useronline where date < $zeit -300”, $link);
    $usergesamt= mysql_fetch_row(MYSQL_QUERY( “SELECT * FROM cs_useronline where ip=’$ip'”, $link));
    if($usergesamt == false)
    {
    $ok= mysql_query(“INSERT INTO cs_useronline (ip,host,date) VALUES(‘$ip’,’$hostering’,’$zeit’)”, $link);
    }
    $resultit = mysql_query(“SELECT Count(*) as total FROM cs_useronline”, $link);
    $blubb= mysql_fetch_array($resultit);
    echo “<font color=\”$f_color\” size=\”$f_size\” face=\”$f_face\”>$blubb[total] $f_besucheronline<br></font>”;
    ######max user online#####################
    if ($blubb[total] > $holit[maxuser] )
    {
    $jepp=mysql_query(“UPDATE cshits SET maxuser=’$blubb[total]'”, $link);
    }
    #########################################
    $ripper=mysql_query(“SELECT maxuser FROM cshits”, $link);
    $holme=mysql_fetch_array($ripper);
    print “<font color=\”$f_color\” size=\”$f_size\” face=\”$f_face\”>$f_maxonline $holme[maxuser]</font>\n”;
    mysql_close($link);
    ?>
    many thanks for your attention ??
    michiko

    Thread Starter michiko

    (@michiko)

    hi podz,
    do you have any idea how can i solve this problem aside from removing this included file?

    Thread Starter michiko

    (@michiko)

    okay, i already solved the problem. no need to reply anymore.

    I get this error:

    Warning: mysql_affected_rows(): A link to the server could not be established in /path/to/WP/wp-includes/wp-db.php on line 134

    I’m using 1.2 and just installed StatTraq. I think that is when the error showed up. I hate to point.
    Any ideas?
    Somewhat related Q: “If you find a solution to the problem you had, why not post it? “I fixed it.” Doesen’t help anyon else!

    yeah, i’d have to agree with kayaker.
    but you know, it’s a given that many people only journey to a support site when they have a problem. thus the biased view of many devices and applications support site’s illustrating that the item in question is “no good” or “totally screwed.”
    still, we’re running about 20/80 here, and while not the deeper spirit of nobles oblige that some virtual utopia offers, it’s still exceptional.
    so yeah, c’mon back and tell ’em how ya fixed it bub!
    : P
    F.

    I’m getting the same problem, just after installing the MyNetflix 1.5 plugin. Every once in a while, while loading my page, it’ll spit out a ton of errors before showing the plugin’s output, and also a few errors instead of showing the sidebar archives and links lists. A reload of the page will get rid of the errors, but they come back again at other times. Here’s an example of the first few errors:

    Warning: mysql_affected_rows(): A link to the server could not be established in /home/[…]/damek.org/wp-includes/wp-db.php on line 155

    Warning: mysql_insert_id(): 5 is not a valid MySQL-Link resource in /home/[…]/damek.org/wp-includes/wp-db.php on line 158

    Warning: Invalid argument supplied for foreach() in /home/[…]/damek.org/wp-includes/functions.php on line 283

    These errors are each repeated over and over in various orders.

    Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Warning: mysql_affected_rows():’ is closed to new replies.