Hello, I have been writing php for years and have created the following script several times before but for some reason there is an issue with it this time round that I just can not put my finger on.
What it is doing, is using information from a prior SQL which works perfectly, then searching for two more records using values in the first SQL
$recipedata is basically pulling the values item_one and item_two which are words, $itemonedata is pulling information for the entry which has the value of $recipedata item one, and $itemtwodata is doing the same but for item_two.
All SQL's have been checked and work fine, but the section following tells the file what message to give depending on a combination of whether $itemdataone ot $itemdatatwo exist.
// TUTSUMI
$itmone = $recipedata['item_one'];
$itmtwo = $recipedata['item_two'];
$itemonesql = $db->sql_query("SELECT * FROM phpbb_shops_inventory WHERE item_owner_id = '$users_id' AND item_name = '$itmone'");
if(!$itemonesql){message_die(GENERAL_MESSAGE, 'Can not find Item One Data');}
$itemonedata = $db->sql_fetchrow($itemonesql);
$itemtwosql = $db->sql_query("SELECT * FROM phpbb_shops_inventory WHERE item_owner_id = '$users_id' AND item_name = '$itmtwo'");
if(!$itemtwosql){message_die(GENERAL_MESSAGE, 'Can not find Item Two Data');}
$itemtwodata = $db->sql_fetchrow($itemtwosql);
if ( (!$itemonedata) && (!$itemtwodata) )
{
$message = 'You do not have either of the items';
}
else if ( (!$itemonedata) && ($itemtwodata) )
{
$message = 'You do not have $itmone';
}
else if ( ($itemonedata) && (!$itemtwodata) )
{
$message = 'You do not have $itmtwo';
}
else if ( ($itemonedata) && ($itemtwodata) )
{
$message = 'You have both items';
}
else
{
$message = 'erm, im broken';
}
// TUTSUMI
Any help would be really appreciated.