displaying a variable in an echo statement
Posted: Thu Sep 11, 2003 1:50 pm
I have written the following code:
function addfaccert($fid, $flname) {
$cert_array = @mysql_query('SELECT * FROM certs ORDER BY CERTS');
if (!$cert_array) {
die('<h2>Error retrieving certs from table!</h2><br>' .
'Error: ' . mysql_error());
}
echo ('
<p align="center">Add Certification for $flname<p>
<table align="center" border="0" width="70%" cellspacing="6">
');
I have tried every combination of "$flname", \"$flname\", '$flname', ''$flname'', etc to get the variable $flname to display its value but all I get is the printing of the actual variable, i.e. the webpage will display "$flname", or \"$flname\", etc. How do I get the value to print to the browser? (I've left off the rest of the function for space consideration since it doesn't deal with the question)
Thanks.
function addfaccert($fid, $flname) {
$cert_array = @mysql_query('SELECT * FROM certs ORDER BY CERTS');
if (!$cert_array) {
die('<h2>Error retrieving certs from table!</h2><br>' .
'Error: ' . mysql_error());
}
echo ('
<p align="center">Add Certification for $flname<p>
<table align="center" border="0" width="70%" cellspacing="6">
');
I have tried every combination of "$flname", \"$flname\", '$flname', ''$flname'', etc to get the variable $flname to display its value but all I get is the printing of the actual variable, i.e. the webpage will display "$flname", or \"$flname\", etc. How do I get the value to print to the browser? (I've left off the rest of the function for space consideration since it doesn't deal with the question)
Thanks.