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)
{
Did you know?Explore Trending and Topic pages for more stories like this.
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

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

php mail form text wont appear / javascript included
Guys/gals...

I am running into a problem whereby I have a great piece of javascript code that

PHP and MySQL on intranet?
Is it possible to use both these on an intranet network?

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the Fr

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

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