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

UL and LI Add Form
The idea I want here is when the user click on a character name from the drop down select bar at the

Sufficient protection from bad input?
I am writing a simple script to let people upload 'pages' of their own content, be it simply a few b

array empty
Hiya peeps,

Ok here is the codes.

order.php

Code:

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

noob cURL help
I have a pretty basic form that I need to cURL post to a file in my includes folder (includes/login.

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

add text and number image
hi guys ..

ok see i want the user to add their name and pick a number then click get it and i

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi

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