I have the following query to add a record to a table. When it's successful, it displays a blank page with "Record added". What I want to do is catch that message in a variable to display in a formatted message. Can someone tell me how to capture that message into a variable?
$query2 ="INSERT INTO leadsTable
VALUES ('0','$company',
'$contact',
'$phone',
'$fax',
'$street',
'$city',
'$state',
'$zip',
'$license',
'$experience')";
//
$result = mysql_query($query2);
if (!$result) {
print "<b>Update Failed:</b> <br>" . mysql_error();
print "<br>Whole query: " . $query2 . "<br>";
die;
$query2 ="INSERT INTO leadsTable
VALUES ('0','$company',
'$contact',
'$phone',
'$fax',
'$street',
'$city',
'$state',
'$zip',
'$license',
'$experience')";
//
$result = mysql_query($query2);
if (!$result) {
print "<b>Update Failed:</b> <br>" . mysql_error();
print "<br>Whole query: " . $query2 . "<br>";
die;