Por k sale esto en la pagin (ITEM SHOP )

Topic created · 1 Mensajes · 340 Visitas
  • Bueno a meti MD a un pj mio (SOY ADM ) pagina de caes ....
    y cuadno kero comprar lo k he metido en item shop pone esto

    Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\scripts\itemshop\shopbuy.php on line 31
    Kaufen fehlgeschlagen.

    Aki ta la linia 31 >>>> session_start();
    if($_SESSION['id'] == "") {
    die('Logge dich bitte ein!');
    }
    else {

    include('../../inc/dbsettings.php');
    $db = "account";
    mysql_connect($dbhost, $dbuser, $dbpw) OR
    die("ERROR: Connection failed. ".mysql_error());
    mysql_select_db($db) OR
    die("ERROR: DB allready open. ".mysql_error());

    $getuser = "SELECT * from account where login = '" . $_SESSION['id'] . "'";
    $checkuser = mysql_query($getuser);
    $num = mysql_num_rows($checkuser);

    if($num > 0) {

    $array = mysql_fetch_array($checkuser);

    $itemid = $_GET['id'];
    $user = $_SESSION['id'];
    $coins = $_SESSION['coins'];

    $check = "SELECT * from itemshop where value = '" . $itemid . "'";
    $query = mysql_query($check);
    $num = mysql_num_rows($query);
    if($num > 0) {
    $array2 = mysql_fetch_array($query);
    $rescash = $array['coins'] - $array2['coins'];

    if($num > 0 && $rescash >= 0) {
    mysql_select_db('player');
    $i = 0;
    $giveitem = "INSERT INTO item SET owner_id = '" . $array['id'] . "', window = 'MALL', pos = '" . $_SESSION['pos'] . "', count = '1', vnum = '" . $itemid . "', socket0 = '0', socket1 = '0', socket2 = '0'";
    $result = mysql_query($giveitem);

    if($result) {

    if($_SESSION['pos'] == '42') {

    $_SESSION['pos'] = '0'; }
    else { $_SESSION['pos'] = $_SESSION['pos'] + 1; }

    mysql_select_db('account');

    $cashresult = $array['coins'] - $array2['coins'];

    $coins = "UPDATE account set coins = '" . $cashresult . "' where login = '" . $_SESSION['id'] . "'";
    $coinsresult = mysql_query($coins);

    if($coinsresult) {
    $_SESSION['coins'] = $cashresult;

    echo "";
    } else {
    echo "Kaufen fehlgeschlagen.";
    }

    }
    else { echo "Kaufen fehlgeschlagen."; }

    } else { echo "Du hast zu wenig Coins."; }

    } else { echo "Kaufen fehlgeschlagen."; }

    } else { echo "Bitte logge dich ein."; }

    }

    ?>

    AYUDA POR FAVOR :((