tags:

views:

23

answers:

2

i am using insert into db(fname,lname) values ('$fname','$lname') command i want that when this query passes on the nest page it show me which fname and which lname is passed or added like this statement

Following recorded is updated in database successfully

first name = abc
last name  = xyz
+2  A: 

Store the query in a variable, execute and print it out:

$query = "insert into db(fname,lname) values ('$fname','$lname')";
mysql_query($query);
echo $query;

Or, if you want to print just the variables, why can't you just do:

echo 'firstname: '.$fname.' ';
echo 'lastname: '.$lname;

If this is not what you needed, please clarify your question.

Tatu Ulmanen
A: 
$query = "insert into db(fname,lname) values ('$fname','$lname')";

if(mysql_query($query))
{
echo "Following recorded is updated in database successfully\n";

echo "first name = $fname \n";

echo "last name  = $lname \n";

}
streetparade