MYSQL prblm
#1

PHP код:
<?php
$e_mail 
$_POST['EMAIL'];
$IGname $_POST['IGname'];
$NEWIG $_POST['NewIG'];
$dbhandle mysql_connect('127.0.0.1','root','');
if (!
$dbhandle
{
    die(
'DATABASE DOWN ' mysql_error());
}
echo 
"1 - Successfully Connected To DM DataBase<br><br>";
$selected mysql_select_db("DMmod",$dbhandle);
$result mysql_query("SELECT * FROM `accounts`");
while(
$row mysql_fetch_array($result)) 
{
    if((
$row['Username'] == $NEWIG) || ($rn == 0));
    {
        echo 
"ERROR : The name you Selected Already exist , please go back and shous new one<br><br>";
        
$rn 0;
    }
}
if(
$rn == 0
{
    echo 
"Please go back<br><br>";
}
else
{
    while(
$row mysql_fetch_array($result)) 
    {
           if(
$row['Username'] == $IGname)
        {
            echo 
"2 - This name have been identified in ower  DataBase : $IGname<br><br>";
            
$result mysql_query("SELECT id,Username,Email,Online,Level FROM `accounts`");
            while (
$row mysql_fetch_array($result)) 
            {
                   if(
$row['Online']!=0)
                {
                    echo 
"ERROR : PLEASE LOGOUT FROM THE GAME!";
                }
                else if((
$e_mail != $row['Email']) || ($row['Email'] == 0))
                {
                    echo 
"3 - Account Horligne<br><br>ERROR : WRONG E-MAIL Or you doesn't set Your E-MAIL IG!";
                }
                else 
                {
                    echo 
"3 - Account Horligne<br><br>";
                    
$Pay $row['level'] * 10000;
                    
$result mysql_query("UPDATE  `accounts` SET  `Username` =  '$NEWIG' WHERE `accounts`.`Username` =  '$IGname';");
                    
$result mysql_query("UPDATE  `accounts` SET  `Money` =  (`Money`-'$Pay') WHERE `accounts`.`Username` =  '$NEWname';");
                    echo 
"2 - Name Changed Successfully to $NEWname for $Pay<br><br>";
                }
            }
        }
    }
}
mysql_close($dbhandle);
?>
Any help ? i'm making a WebPage for name change for my Gamemod , this is the php code, it's still under work but i get this error

Код:
Fatal error: Call to undefined function mysql_connect() on line 4
Reply
#2

Your php doesn't have access to mysql module. Quite common error found on ******. mysql_* functions are deprecated as well, use mysqli_*/PDO. Also, ****** "sql injection prevention".
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)