What are 'Dagger' and 'Fist Weapon' anyway - variables, constants, strings? I noticed, but ignored, the fact that 'Fist weapon' had a space in it. If it is a variable then how did you get this far? If it is a string literal, ie you are looking for the word "dagger" in $item['type'] then you need to quote these strings. Knowing what you are doing here will help.
To answer your question, you are correct, I am looking for a word Dagger in $item['type']. The code was working fine when I use this statement below without putting Dagger in quotes:
if(($session['cid'] == 2) && ($item['type'] == Dagger) && ($item2['type'] == Dagger)){
$DualWield=", equip='10'";
However, when I tried to add the new statement to include Fist Weapons, that's when I ran into the problems with the errors.
Do you think I need to put quotes around Fist Weapons and leave the quotes off Dagger? Is that even possible without triggering errors.
To give you a little more insight on what the statement is suppose to do:
It is checking the database to see if cid (hero id) is 2 and the hero is holding a Dagger in hand 1 and Dagger in hand 2, then equip it for double wielding.
The new statement is so it will check to see if the hero (hero id) is 2, and if the hero is holding Fist Weapon in 1 hand, and another Fist Weapon in hand 2, then again, it will equip it for double wielding.
Any suggestions? It's just strange that the first line of code works perfectly for Daggers but when I try to add Fist Weapons in the statement, I get all the errors.
I don't know enough about php to know why it worked with unquoted "dagger" but I think it's good policy to quote all strings in any programming language. It might be worth investigating the string matching functions, too. Not only will it emphasize the fact that you are using strings but it gives you the option to ignore case if you like.