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

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

Two fgetcsv related questions ;D
First of im trying to get a file from a merchants server but the directory is protected, I know the

Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 app

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

Problems with returning true or false in eval()'d code
Hi guys,

Would appreciate some help with a problem when running eval() on a function that sho

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

how can we add data from dynamic fields to mysql db in php
i have a script which i found on the internet. i modify that script according to my needs. what is i

Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year change

Slow data retrieval which requires improvement..please help
I am working on a Help Desk Ticketing system and have a page called MY TICKETS which shows all ticke

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