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

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

Convert .fdf to .pdf
I currently have a web form that uploads the form data to an .fdf file and emails it.

However

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

ALV grid with 2 headers
Hi Gurus,

I need to display ALV GRID as below.

Header1

Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

help finding hacking loopholes
i was attacked by a redirect php injection

my pc is clean of viruses

so i figure that

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?

I was thinking s

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