Just need a little help with onLoad

Okay everything is works fine nothing problem …send value,save value in dtbase…only my problem …(maybe not a big problem)…how to echo from php so that user know sometimes their process saving dt into dtbase are not working…because currently…it will show in flash the saving process are success eventhough it’s fail…so actually the process in php page I think…because in flash everything is okay…so I really need help on that…or some guide would be great…


<?
   $dbhost = "localhost";
   $dbusername = "root";
   $dbpassword = "";
   $dbname = "ecard";
  
   $db = mysql_connect($dbhost, $dbusername, $dbpassword);
   mysql_select_db($dbname, $db) or die("ERROR: Cannot connect to the database");

if (!get_magic_quotes_gpc()) {
  foreach($_POST as $key=>$value) {
    $temp = addslashes($value);
    $_POST[$key] = $temp;
    }
  }

 $query = 'INSERT INTO customizecard  (customization,username,whattime)
          VALUES ("'.$_POST['userediting'].'","'.$_POST['usr_name'].'",now())';
		 				
 $proceedSQL = mysql_query($query) or die(mysql_error());
 
//for success saving process it 's okay and show ok in flash..
//the problem is for failing process is still show success it's okay eventhough I put the else in php... 
if(success==true){
 	$somemessage = 'your data has been save into database';
 	echo '&message='.urlencode( $somemessage );
}
//else{
     //  $somemessage = 'problem occure';
 //	echo '&message='.urlencode( $somemessage );
//}

?>


and this is as in flash…


var receiveVars:LoadVars = new LoadVars();
receiveVars.onLoad = loadstatus;

function loadstatus(success:Boolean){
	if(success){
//for success it's okay only for fail process can get status from php
		info.text = this.message;
	}else{
		info.text = "this.message";
	}
}


anyhelp would be appreciated…

tq again…