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

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

Help Optimizing code
Good Morning,

I wrote a small import function for a website of mine and I know there has to b

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Google Map
I have done Google Map Integration for one my project. But for that we need the "latitude and l

Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past

Database 'Validation'
Hi everyone,
I'm trying to validate the password entered by the user with the password in the dat

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

MYSQL INSERT ID NOT WORKING
Code: $id = mysql_insert_id();
header("Location: ./?view=$id");
Why $id pulling blan

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

Multi-image upload problems
Lets see if I can get some help on this one. Can anyone show me what I am doing wrong here. I'm just

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