Page 1 of 1

Simple PHP Help Needed

Posted: Tue Mar 16, 2010 3:21 am
by NZAAN
I've been pretty good at figuring things out on my own, but im stumped...

I am calling infomation with this:

Code: Select all

	        $iteminfo="SELECT * from items where id='$playerid'";
		$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
		$iteminfo3=mysql_fetch_array($iteminfo2);
If $playerid and say, $itemtype aren't both found in that table (itemtype isnt in the call yet...) then I want to go through with something. If they are found, then I want to go through with something else...

Can anyone help me out? I am sure its rediculously easy, but im pretty new... :(

Re: Simple PHP Help Needed

Posted: Tue Mar 16, 2010 3:23 am
by hallsofvallhalla

Code: Select all

if(isset($iteminfo3['name']))
{
do the code

}

else
{
echo "Player has no items";
}
you mean like that?

Re: Simple PHP Help Needed

Posted: Tue Mar 16, 2010 3:26 am
by NZAAN
**deleted

Re: Simple PHP Help Needed

Posted: Tue Mar 16, 2010 3:37 am
by NZAAN
hallsofvallhalla wrote:

Code: Select all

if(isset($iteminfo3['name']))
{
do the code

}

else
{
echo "Player has no items";
}
you mean like that?
That's perfect, thank you!