True way to see if action was successful?


Posted on 16th Feb 2014 07:03 pm by admin

If this is a good way to see if action was successful to continue:

Code: function changeGameState($GameId)
{
mysql_query("UPDATE challenges SET status=status+1 WHERE id='$GameId'");
}

if (changeGameState($someId))
{
//was successful
}
I dont know if it work or not, but i think no because changeGameState wont return any value, so I came up with another idea, but it gives me "Parse error: syntax error, unexpected T_RETURN " error in "return 0" line

Code: public function changeGameState($GameId)
{
mysql_query("UPDATE challenges SET status=status+1 WHERE id='$GameId'")or die(return false);
return true;
}
how can i check if action was succesful before continuing?

No comments posted yet

Your Answer:

Login to answer
135 Like 30 Dislike
Previous forums Next forums
Other forums

Create PHP table grid help, please
I have a MySQL database setup, now it's time for the table (gridview) design in php. Here's the prob

How do i use vars in an array
Hiya peeps!

How do I use a var in an array. You will see $id but it isnt working.


Points for Wiki contribution
Hi everyone,

I want to know how long does it take for the moderator to award points for a

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

insert mysql embeded videos as blobs?
Using TinyMCE my client will be able to embed images and flash videos into large columns of text whi

SAP Business Suite
Hi all:

Within the SAP Business Suite solution I would like to ask you the main differenc

cURL Upload Help
OK, I am creating a bridge from a local program to my website and I am trying to find the best way t

SWF image using php?
Hello once again.

My latest en devour requires me to produce an image of a static .swf that i

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash