开发者

print passes values

开发者 https://www.devze.com 2022-12-15 03:23 出处:网络
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 st

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 updat开发者_JAVA技巧ed in database successfully

first name = abc
last name  = xyz


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.


$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";

}
0

精彩评论

暂无评论...
验证码 换一张
取 消