cant insert my weapon to player.

C++, C#, Java, PHP, ect...
Post Reply
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

cant insert my weapon to player.

Post by tomtefan »

I think i have it all covered, but obviously i dont =P

1* I have the structure and values asigned.
2* the DB also have misstext and hittext structure. both on playerweapons and the shop.
3* i also use lowercasings all over the place so i dont have to worry about that.

still i get the error "could not insert the damn weapon into backpack"

what am i missing ???


$playerid = $playerinfo3['id'];
$name = $iteminfo3['name'];
$misstext1 = $iteminfo3['misstext1'];
$misstext2 = $iteminfo3['misstext2'];
$misstext3 = $iteminfo3['misstext3'];
$misstext4 = $iteminfo3['misstext4'];
$hit = $iteminfo3['hit'];
$wlevel = $iteminfo3['level'];
$hittext1 = $iteminfo3['hittext1'];
$hittext2 = $iteminfo3['hittext2'];
$hittext3 = $iteminfo3['hittext3'];
$hittext4 = $iteminfo3['hittext4'];
$damage = $iteminfo3['damage'];
$randid = rand(1000,999999999);
$price = $iteminfo3['price'];


$itembought = "INSERT into playerweapons(pid, name, hit, level, randid, price, misstext1, misstext2, misstext3, misstext4, class, hittext1, hittext2, hittext3, hittext4, damage) VALUES ('$playerid','$name','$hit','$wlevel','$randid','$price','$misstext1','$misstext2','$misstext3','$misstext4','$class','$hittext1','$hittext2','$hittext3','$hittext4','$damage')";
mysql_query($itembought) or die("could not insert the damn weapon into backpack");
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: cant insert my weapon to player.

Post by Chris »

Try replace:

Code: Select all

or die("could not insert the damn weapon into backpack");
 
with

Code: Select all

or die( mysql_error() );
 
Fighting for peace is declaring war on war. If you want peace be peaceful.
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

Re: cant insert my weapon to player.

Post by tomtefan »

TY.

found the problem wich i solved. (was missing a "hit" column in the db at some place)
then another problem came up. wich i also solved. =P
so now iam gonna try and fix yet another one, a bugging damage. i sometime get a negative damage hehehe
"you hit for -3damage" etc. should just be a math problem.

Ohhh that reminds me, i have to try and make a Random Fumbling variable text also, where you might accidentaly damage yourself or someting funny like that :D


"Game making is like medicin. fix one problem and get two others." haha, just made that up. :lol:
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: cant insert my weapon to player.

Post by hallsofvallhalla »

love the subject
cant insert my weapon to player.
its called stabbing.. :P
Post Reply

Return to “Coding”