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

do while conditions
i want to display 6 images in a 2x3 table
now what would be the correct logic to
count that th

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days.

Custom array sort? asc then desc
Any ideas how I could sort this array? I've been trying for a while. Maybe with usort, but I have no

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

weeks in a year
hi,

i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct

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