Jump to content
GIGN Forum

Mysql_error.


Zorg`s
 Share

Recommended Posts

<?
if(isset($_POST['prece'])) {
            
            if ($_POST['prece'] == '1') {
                $links = './dooring/playline_web_lietas.zip';
                
            }
            elseif ($_POST['prece'] == '2') {
                $links = '/SHOP/dooring/acc.rar';
                
            }
            elseif ($_POST['prece'] == '3') {
                $links = '/SHOP/dooring/unban.rar';
                
            }
            elseif ($_POST['prece'] == '4') {
                $links = '/SHOP/dooring/nick.rar';
                }    
                  }
            elseif ($_POST['prece'] == '5') {
                $links = '/dooring/unban.rar';
                
                }
            elseif ($_POST['prece'] == '6') {
                $links = '/dooring/nick.rar';
                }    

    
    $code = $_POST["kods"];
    $price = 'cena';
//izvelas kodu datubazi, lai parbauditu, vai kods ir derigs
$con = mysql_connect("localhost","root","parole");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
$db_selected = mysql_select_db("shop", $con);
if (!$db_selected) {
    die (mysql_error());
}
//parbauda vai der
[b]if(mysql_result(mysql_query("SELECT COUNT(*) FROM code WHERE code = '$code'"),0,'COUNT(*)') > 0){[/b]
        echo "<b><body background-color:#C0C0C0><br>Kods ir derīgs! Lejupielādēt vari <a href='$links'>šeit</a>!";
    }
else{
    echo "<script>alert('Nepareizs kods!');window.back()</script>";
    unset($code);
    exit();
}
$delete = "DELETE FROM code WHERE code = '$code'";
mysql_query($delete) or die(mysql_error());
mysql_close();
?>

It kā šeit ir kļūda, tikai nesaprotu, kas :( Būtu labi, ja kāds palīdzētu.

Warning: mysql_result():supplied argument is not a valid MySQL result resource in .... on line 82
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...