Jump to content

[SOLVED] gonna rip my hair out.


Canadiengland

Recommended Posts

this isnt working... when i click on it from the url equip.php?itemid=20 it just keeps saying "unable to create item."

 

am i missing something really obvious here? gawd!

 

if you can edit the code so it works thatd be great, or if you can just point out what im doing wrong that would also be super. thanks guys.

<?php

include "connect.php";

$itemid = $_GET['itemid'];
if (isset($_SESSION['player'])) 
  {
    $player=$_SESSION['player'];
    $userstats="SELECT * from km_users where playername='$player'";
    $userstats2=mysql_query($userstats) or die("Could not get user stats");
    $userstats3=mysql_fetch_array($userstats2);

    $equip="SELECT * from km_items where owner='$player' and status='u'";
    $equip2=mysql_query($equip) or die("Could not get user stats");
    $equip3=mysql_fetch_array($equip2);
    
    mysql_query("UPDATE km_items SET status='e' WHERE id='$itemid'");
    print "You equipped the $equip3[name]. (<a href=equip.php>refresh</a>)";  


    }
    else
    {
       print "Unable to equip item.";
    }
?>code]

Link to comment
https://forums.phpfreaks.com/topic/43213-solved-gonna-rip-my-hair-out/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.