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

md5 is it unique
I know this is most likely one of many simple questions that can be found semi easily. But I'm press

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

Help with php code
Hello, can anyone tell me why this php word trap fails to work,
and the trigger words get blow r

Is it possible to view php source code??
Hi All

I was just wondering if it's possible to view a websites php source code?
I know

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

I got my hosting suspended XD
So I saw this challenge a day or so ago

http://www.programming-challenges.com/pg.php?page=dow

form problem
Hi all, I think this is going to be easy to resolve but for I have been looking at it to long and I

Script not running properly
Hello Everyone
This is a basic script for posting to a database. I'm not sure why it doesn't work

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