Lilith Posted July 3, 2010 Share Posted July 3, 2010 Error: Query was INSERT INTO items VALUES('',7,'test helmet','test',20,10,0, '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', 0, 0, 10, 0, 0, 0, 0) Query: $m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $boots, $helmet, $breastplate, $leggings, $gloves, $armor)"); I have looked at the SQL tables in myphpadmin, and IM probably just missing the obvious. Any hints? Quote Link to comment Share on other sites More sharing options...
arcanine Posted July 6, 2010 Share Posted July 6, 2010 thanks :D everything is working fine for me except one thing and thats the give item function. i went to mdk invent thread and found somthing like it and change the give item func code but now i just have a blank screen when i click give item =/ anyone know the solution or experienced this problem? Quote Link to comment Share on other sites More sharing options...
arcanine Posted July 6, 2010 Share Posted July 6, 2010 this is my error. QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO inventory VALUES('',3,1,1,0,0) Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 6, 2010 Share Posted July 6, 2010 There is no where near enought coloums in there Quote Link to comment Share on other sites More sharing options...
Lilith Posted July 7, 2010 Share Posted July 7, 2010 Error: Query was INSERT INTO items VALUES ('',7, this is the ('',{$_POST['itmtype']}, 'test helmet', is the '$itmname', 'test', is the $itmdesc', 20, is the {$_POST['itmbuyprice']}, 10, is the {$_POST['itmbuyprice']}, 0, is the {$_POST['itmsellprice']}, '0', is the $itmbuy, 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx1', '0', is the '{$_POST['effect1on']}', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx2', '0', is the '{$_POST['effect2on']}', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx3', 0, is the {$_POST['effect3on']}', 0, is the $weapon, 10, is the $boots, 0, is the $helmet, 0, is the $breastplate, 0, is the $leggings, 0) is the $gloves, I removed the $armor, and still not working. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 7, 2010 Share Posted July 7, 2010 export your table and post that. Quote Link to comment Share on other sites More sharing options...
Lilith Posted July 7, 2010 Share Posted July 7, 2010 Field Type Collation Attributes Null Default Extra Action itmid int(11) No None auto_increment itmtype int(11) No 0 itmname varchar(255) latin1_swedish_ci No itmdesc text latin1_swedish_ci No None itmbuyprice int(11) No 0 itmsellprice int(11) No 0 itmbuyable int(11) No 0 effect1_on tinyint(4) No 0 effect1 text latin1_swedish_ci No None effect2_on tinyint(4) No 0 effect2 text latin1_swedish_ci No None effect3_on tinyint(4) No 0 effect3 text latin1_swedish_ci No None weapon int(11) No 0 armor int(11) No 0 boots int(11) No None helmet int(11) No None breastplate int(11) No None leggings int(11) No None gloves int(11) No None theres my table Quote Link to comment Share on other sites More sharing options...
savage129 Posted July 8, 2010 Share Posted July 8, 2010 i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 8, 2010 Share Posted July 8, 2010 Field Type Collation Attributes Null Default Extra Action itmid int(11) No None auto_increment itmtype int(11) No 0 itmname varchar(255) latin1_swedish_ci No itmdesc text latin1_swedish_ci No None itmbuyprice int(11) No 0 itmsellprice int(11) No 0 itmbuyable int(11) No 0 effect1_on tinyint(4) No 0 effect1 text latin1_swedish_ci No None effect2_on tinyint(4) No 0 effect2 text latin1_swedish_ci No None effect3_on tinyint(4) No 0 effect3 text latin1_swedish_ci No None weapon int(11) No 0 armor int(11) No 0 boots int(11) No None helmet int(11) No None breastplate int(11) No None leggings int(11) No None gloves int(11) No None theres my table Well if thats your table I wouldnt remove the armor as then your going to get the error as the table count is wrong. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 8, 2010 Share Posted July 8, 2010 i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out At a brief glance your looking at the $defence which is deducted from the attacking hit. If its not being deducted as it should then thats the area in question that is not working and I would check the $defence part of the code. Quote Link to comment Share on other sites More sharing options...
savage129 Posted July 13, 2010 Share Posted July 13, 2010 i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out At a brief glance your looking at the $defence which is deducted from the attacking hit. If its not being deducted as it should then thats the area in question that is not working and I would check the $defence part of the code. i found it. its the $adefense, change $adefense = $boots+helmet+$breastplate+$leggings+$gloves+0; to $adefense = $aboots+$ahelmet+$abreastplate+$aleggings+$agloves+0; Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted August 5, 2010 Share Posted August 5, 2010 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I get that from the inventory.php any reasons why? Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted August 5, 2010 Share Posted August 5, 2010 (0,0,,0,0,0,0,0) something should be between those ,, Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted August 5, 2010 Share Posted August 5, 2010 0,0,,0,0,0,0,0 isn't even in staff_items.php or inventory.php Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted August 5, 2010 Share Posted August 5, 2010 LOL do you even read your own posts or what your typing at the time. You said that was the error from your inventory.php. So the error is from the query in that file. Quote Link to comment Share on other sites More sharing options...
medz Posted September 6, 2010 Share Posted September 6, 2010 Hi Is there any live demo of this attack script? Thanks! Quote Link to comment Share on other sites More sharing options...
sixsens Posted October 14, 2012 Share Posted October 14, 2012 this is how i did it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
sniko Posted October 14, 2012 Share Posted October 14, 2012 this is how i did it You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. order by rand() is bad practice... Quote Link to comment Share on other sites More sharing options...
sixsens Posted October 14, 2012 Share Posted October 14, 2012 what would you do? Quote Link to comment Share on other sites More sharing options...
sniko Posted October 14, 2012 Share Posted October 14, 2012 what would you do? For one I wouldn't have the ORDER BY clause in your queries. No point, as you're selecting a specific item, using the primary key; itmid Quote Link to comment Share on other sites More sharing options...
sixsens Posted October 14, 2012 Share Posted October 14, 2012 For one I wouldn't have the ORDER BY clause in your queries. No point, as you're selecting a specific item, using the primary key; itmid seem that i dont need thos rand() You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 23, 2013 Share Posted February 23, 2013 Can someone help me with inventory.php? I'm having problems understanding this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Because the query turns out to be: SELECT * FROM `items` WHERE `itmid` IN(0,0,0,0,0,0) And that doesn't return anything, resulting in $equip never being set. Help? Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted February 23, 2013 Share Posted February 23, 2013 (edited) Can someone help me with inventory.php? I'm having problems understanding this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Because the query turns out to be: And that doesn't return anything, resulting in $equip never being set. Help? Echo the weapon then you can be sure if it is selecting it. such: echo ''.$equip[$ir['equip_primary']]['itmname'].''; Also make sure in your database those items are being equipped, if not then the problem is in your equip.php page. Edited February 23, 2013 by lucky3809 Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 23, 2013 Share Posted February 23, 2013 Echo the weapon then you can be sure if it is selecting it. such: echo ''.$equip[$ir['equip_primary']]['itmname'].''; It's writing out this, so I'm pretty sure: A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: equip (8) Line executed: ../inventory.php:22 None equipped. Quote Link to comment Share on other sites More sharing options...
peterisgb Posted March 11, 2013 Share Posted March 11, 2013 i know that this mod is a old mod but i noticed one thing that was never mentioned in this whole thread and that is unequip the items. so i edited mine and here it is You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I'm not very good at this but i am surprised to notice not one person ever mentioning removing the items. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.