Im wondering how i could add a success or fail message to return at the end of this function
function InsertIntoDB($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, $field9){
$sql = "INSERT INTO `caches` ( `url` , `username` , `password` , `cachename` , `lat` , `long` , `message` , `notes` , `tags` ) VALUES( '{$field1}' , '{$field2}' , '{$field3}' , '{$field4}' , '{$field5}' , '{$field6}' , '{$field7}' , '{$field8}' , '{$field9}' ) ";
mysql_query($sql) or die(mysql_error());
}
Id like it to return “OK” on success, and “FAIL” on failure.
What do you define to be success?
If you define mysql_query() returning true to be a success, then the following will work: