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

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

insert PHP code into function
Hi,
I'm having problems when trying following:

I have:
Code: [Select]createBar("Do

unserialize help, getting errors
hi all ,
I got a form with 6 fields (2 input and 4 select box), when the page loads one block is

What are the two different files you download to update kernel?
What are the two different files you download to update kernel?

cURL and Sessions
Ohai.

So, I'm trying to cURL a bunch of things off of a page, and put them into a session. I'

MS are the best!!!
Visit http://www.microsoft.com/australia/windows/default.aspx?h=watch-a-demo and click the massive '

Taking an HTML form and a PHP program and making it into one working file.
Hello,

So I would like to display everything INSIDE a specific directory. In other words, I

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

PHP5/Zend 2.0 - Resources
PHP5 Snapshots
http://snaps.php.net/

ZEND 2.0 Feature Overview and Design (PDF File

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