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

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

Cloud Computing?
Hello,

I was wondering if anyone could help explain this term to me. I'm starting to hear it

timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)
in my mysql db u

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this error

Code: Warning: mys

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

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

Help with captcha script needed
Hello,

I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f

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