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

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one n

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Help with lottery style system?
I'm working on a currency system for forums and it is going to have a type of lottery system built i

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
We have SAP XMII 12.0 setup running on Netweaver 2004s,7.0, Java Stack only.

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Need Help with a query
Hello,
For some reason I am just not getting the right answer when I do this query and not quite

Allowing ' and "
Hello everyone,

I am creating a form where users submit information to go into a database. I

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