Simple PHP Help Needed

C++, C#, Java, PHP, ect...
Post Reply
NZAAN
Posts: 13
Joined: Sun Sep 27, 2009 12:16 am

Simple PHP Help Needed

Post 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... :(
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Simple PHP Help Needed

Post by hallsofvallhalla »

Code: Select all

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

}

else
{
echo "Player has no items";
}
you mean like that?
NZAAN
Posts: 13
Joined: Sun Sep 27, 2009 12:16 am

Re: Simple PHP Help Needed

Post by NZAAN »

**deleted
Last edited by NZAAN on Tue Mar 16, 2010 3:37 am, edited 1 time in total.
NZAAN
Posts: 13
Joined: Sun Sep 27, 2009 12:16 am

Re: Simple PHP Help Needed

Post 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!
Post Reply

Return to “Coding”