Warning supply argument not a valid MySQL

Results 1 to 2 of 2
  1. #1
    Enthusiast alrock55 is offline
    MemberRank
    Apr 2009 Join Date
    44Posts

    sad Warning supply argument not a valid MySQL

    anyone can tell me where the mistake?

    following my index.php
    PHP Code:
    <body bgcolor="#161616">
    <font color=white>


    <? //=====Script by trash=====//  //=====For MySQL Database=====//
        
    include "status.php";

    include 
    "config.php";
        
        
    $Data '<form action=index.php method=post>
         Login:  
        <br><input type=text name=login><br><br>
         Password:
        <br><input type=password name=passwd><br><br>
         Repeat password:
        <br><input type=password name=repasswd><br><br>
        Email:
        <br><input type=text name=email><br><br>
        <input type=submit name=submit value="Registration">
        </form>'
    ;
            
        if (isset(
    $_POST['login']))
            {
                
    $Link MySQL_Connect($DBHost$DBUser$DBPassword) or die ("Can't connect to MySQL");
                
    MySQL_Select_Db($DBName$Link) or die ("Database ".$DBName." do not exists.");
                
                
    $Login $_POST['login'];
                
    $Pass $_POST['passwd'];
                
    $Repass $_POST['repasswd'];
                
    $Email $_POST['email'];
                
                
    $Login StrToLower(Trim($Login));
                
    $Pass StrToLower(Trim($Pass));
                
    $Repass StrToLower(Trim($Repass));
                
    $Email Trim($Email);
        
            if (empty(
    $Login) || empty($Pass) || empty($Repass) || empty($Email))
                {
                    echo 
    "All fields is empty.";
                }
            
            elseif (
    ereg("[^0-9a-zA-Z_-]"$Login$Txt))
                {
                    echo 
    "Login have a incorrect format.";
                }
                
            elseif (
    ereg("[^0-9a-zA-Z_-]"$Pass$Txt))
                {
                    echo 
    "Password have a incorrect format.";    
                }
            
            elseif (
    ereg("[^0-9a-zA-Z_-]"$Repass$Txt))
                {
                    echo 
    "Repeat password have a incorrect format.";    
                }
            elseif (
    StrPos('\''$Email))
                {
                    echo 
    "Email have a incorrect format.";    
                }    
            else
                {
                    
    $Result MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
                    
            if (
    MySQL_Num_Rows($Result))
                {
                    echo 
    "Account <b>".$Login."</b> is exists";
                }
            
            elseif ((
    StrLen($Login) < 4) or (StrLen($Login) > 10)) 
            
                {
                    echo 
    "Login must have more 4 and not more 10 symbols.";
                }
                
            elseif ((
    StrLen($Pass) < 4) or (StrLen($Pass) > 10)) 
            
                {
                    echo 
    "Password must have more 4 and not more 10 symbols.";
                }
                
            elseif ((
    StrLen($Repass) < 4) or (StrLen($Repass) > 10)) 
                {
                    echo 
    "Repeat password must have more 4 and not more 10 symbols.";
                }
                
            elseif ((
    StrLen($Email) < 4) or (StrLen($Email) > 25)) 
                {
                    echo 
    "Email must have more 4 and not more 25 symbols.";
                }
            
            elseif (
    $Pass != $Repass)
                {
                    echo 
    "Password mismatch.";
                }        
            else
                {
                    
    $Salt $Login.$Pass;
                    
    $Salt md5($Salt);
                    
    $Salt "0x".$Salt;
                    
    MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '0', '$Email', '0', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query.");
                    echo 
    "Account <b>".$Login."</b> has been registered.";
                }        
            }    
        }
        
        echo 
    $Data;    
        
    ?>
    Config.php
    PHP Code:
    <? //=====Script by trash=====//  //=====For MySQL Datatbase=====//

        
    $DBHost "localhost";  // localhost or your IP
        
    $DBUser "root";  // Database user
        
    $DBPassword "hrace009";  // Database password
        
    $DBName "dbo";  // Database name
        
    ?>
    Status.php
    PHP Code:
    <?php  //=====Script by trash=====//  //=====For MySQL Datatbase=====//


        /*-------Config------*/
        
            
    $DBHost "localhost";  // localhost or your IP
            
    $DBUser "root";  // Database user
            
    $DBPassword "hrace009";  // Database password
            
    $DBName "dbo";  // Database name
            
    $ServerIP "10.10.10.15";  // IP your PW Server 
            
    $ServerPort "29000";  // Port your PW Server
            
        /*-------Status-------*/
        
        
    $Link MySQL_Connect($DBHost$DBUser$DBPassword);
        
    MySQL_Select_Db($DBName$Link);
        
    $Result MySQL_Query("SELECT ID FROM online");
        
    $Count 0;
        
        while (
    $Rows MySQL_Fetch_Array($Result))
            {
                
    $Count++;
            }

        
    $Sockres = @FSockOpen($ServerIP$ServerPort$errno$errstr1);
                
            if (!
    $Sockres
                {
                    
    MySQL_Query("DELETE FROM online");
                    
    $Count 0;
                    echo 
    "Server: <font color=red>Offline</font>";            
                } 
            else 
                {
                    @
    FClose($Sockres);
                    echo 
    "Server: <font color=blue>Online</font>";
                }
            
        
        echo 
    "<br>Users Online: ".$Count;
        
    ?>
    Attached Thumbnails Attached Thumbnails untitled.gif  
    Last edited by alrock55; 20-10-10 at 05:15 PM.


  2. #2

    Re: Warning supply argument not a valid MySQL

    Edit ip on Config.php put servers local ip addres like 192.168.0.1



Advertisement