Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2014
    Posts
    14
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Query Errors | Total Noob | Please Help Me

    Hello I am trying to run a payout cron but am getting a ton of errors. I do not know anything about coding so was hoping someone could help fix these for/with me?

    Notice: Use of undefined constant uid - assumed 'uid' in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 19
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 17
    Notice: Use of undefined constant uid - assumed 'uid' in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 30
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 28
    Notice: Use of undefined constant uid - assumed 'uid' in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 41
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 39
    Notice: Use of undefined constant uid - assumed 'uid' in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 52
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 50
    Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 68
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 65
    Notice: Use of undefined constant family - assumed 'family' in /var/www/vhosts/steam-wars.com/httpdocs/beta/files/devarea2.php on line 93
    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 'Terry_Creek_Mafia' AND family_position='King Pin''' at line 1

    PHP Code:
    <?php
    echo "<table width='100%'><tr><td valign='left' width='95%'><font size=2 color=silver><b>Development Stage 2</b></font></td><td><table width=100%><tr><td align=right>";
    include(
    '../beta/files/link.php');
    echo
    "'></a></td></tr></table><img src='/beta/layout_images/headertop.gif' width=100% height=4></center><br /><br />";
    if(!isset(
    $tools)){
    echo
    "<font color=red><b>Error | It Seems Something Went Wrong Processing Your Account. Please Try Logging Out And Then Logging Back In. If The Problem Persists Please Email Support At Account@Steam-Wars.com. We Apologize For The Inconvenience.</b></font><br /><br /><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center><br />";
    session_destroy();
    exit();}    


    ini_set('display_errors'1);
    error_reporting(E_ALL);  
    $sql="SELECT nickname, email, rank, uid, SUM(bank+cash) AS nw FROM user_characters WHERE rank!='Admin' and rank!='Forum Mod' and nickname!='Guest' and rank!='Public Relations' GROUP BY nickname ORDER BY nw DESC LIMIT 0,5;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+200 WHERE uid=".$temp[uid]."";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$temp['email']."', '<br>Congratulations. You Have Won 200 B.D(s) For Finishing Within The Top 5 Networth. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}
                 
    $sql="SELECT nickname, email, rank, uid, SUM(bank+cash) AS nw FROM user_characters WHERE rank!='Admin' and rank!='Forum Mod' and nickname!='Guest' and rank!='Public Relations' GROUP BY nickname ORDER BY nw DESC LIMIT 0,10;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+100 WHERE uid=".$temp[uid]."";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$temp['email']."', '<br>Congratulations. You Have Won 100 B.D(s) For Finishing Within The Top 10 Networth. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}
                 
    $sql="SELECT nickname, email, rank, uid, SUM(bank+cash) AS nw FROM user_characters WHERE rank!='Admin' and rank!='Forum Mod' and nickname!='Guest' and rank!='Public Relations' GROUP BY nickname ORDER BY nw DESC LIMIT 0,25;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+50 WHERE uid=".$temp[uid]."";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$temp['email']."', '<br>Congratulations. You Have Won 50 B.D(s) For Finishing Within The Top 25 Networth. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}
                 
    $sql="SELECT nickname, email, rank, uid, SUM(bank+cash) AS nw FROM user_characters WHERE rank!='Admin' and rank!='Forum Mod' and nickname!='Guest' and rank!='Public Relations' GROUP BY nickname ORDER BY nw DESC LIMIT 0,50;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+25 WHERE uid=".$temp[uid]."";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$temp['email']."', '<br>Congratulations. You Have Won 25 B.D(s) For Finishing Within The Top 50 Networth. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}




                    
    $sql="SELECT rank, owner, name FROM newspaper_company ORDER BY rank DESC LIMIT 0,1";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $uid "SELECT uid, email FROM user_characters WHERE 'nickname' ='".$temp['owner']."'";
            
    $uidd=mysql_fetch_array($uid); 
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+100 WHERE 'uid'='".$uidd['uid']."'";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$uidd['email']."', '<br>Congratulations. You Have Won 100 B.D(s) For Finishing With The Top Ranked Newspaper ".$temp['name'].". ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}


                    
    $nw2="SELECT firstlegend FROM game_settings";
                    
    $uid "SELECT uid, email FROM user_characters WHERE nickname ='".$nw2."'";
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+100 WHERE uid='".$uid['uid']."'";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$uid['email']."', '<br>Congratulations. You Have Won 100 B.D(s) For Finishing As First Legend Of The Round. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());




             
    $sql="SELECT family, SUM(bank+cash) AS cnt FROM $prefix.user_characters WHERE family != '' and  family!='~Steam-Wars-Societeh~' GROUP BY family ORDER BY cnt DESC LIMIT 0,1;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $fam "King Pin";
                    
    $uid "SELECT uid, email FROM user_characters WHERE family ='".$temp[family]."' AND family_position='".$fam."'";
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+500 WHERE uid='".$uid."'";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$uid['email']."', '<br>Congratulations. You Have Won 500 B.D(s) For Finishing With The Top Faction. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}



             
    $sql="SELECT familyname, drug_profit, creator FROM $prefix.families WHERE familyname != '' and  familyname!='~Steam-Wars-Societeh~' GROUP BY familyname ORDER BY drug_profit DESC LIMIT 0,1;";
                     
    $sql=mysql_query($sql);
                      if(@
    mysql_num_rows($sql)==0) {}
                     else {
                     while(
    $temp=mysql_fetch_array($sql)) 
            {
                    
    $uid "SELECT uid FROM user_characters WHERE nickname ='".$temp[creator]."'";
                    
    $sql "UPDATE users_goldcoins SET goldcoins=goldcoins+500 WHERE uid='".$uid."'";
            
    $sql mysql_query($sql) or die(mysql_error());
            
    $sql    "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$uid['email']."', '<br>Congratulations. You Have Won 500 B.D(s) For Finishing With The Top Faction Smuggling Points. ', '$time')";
            
    $sql mysql_query($sql) or die(mysql_error());
                     }}

    ?>

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    You have made a large series of threads, all with pretty much the same basic fundamental errors in them.

    If you don't have the coding skills to solve these basic fundamental problems yourself OR to even understand the replies you have already been given and apply them throughout the code, you should not be attempting this.

    Go and read through a php/mysql book or a set of basic php/mysql tutorials so that you can at least understand and make use of the help you have already been given.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •