Php write()fpdf中的echo数据库
如何在write()中回显学生姓名?谢谢尝试在字符串中使用“{$var}”: 例如:Php write()fpdf中的echo数据库,php,fpdf,Php,Fpdf,如何在write()中回显学生姓名?谢谢尝试在字符串中使用“{$var}”: 例如: $con = mysqli_connect("localhost","root","","final_osa"); $sel_query="SELECT * FROM ched_scholars WHERE id = '".$_GET['id']."';"; $result = mysqli_query($con,$sel_query); while($row = mysqli_fetch_assoc($res
$con = mysqli_connect("localhost","root","","final_osa");
$sel_query="SELECT * FROM ched_scholars WHERE id = '".$_GET['id']."';";
$result = mysqli_query($con,$sel_query);
while($row = mysqli_fetch_assoc($result)) {
$pdf->Write( 6, 'I, echo $row["student_name"];, of legal age and a resident of echo $row["present_address"]; understand that an Educational Scholarship/Financial Grants-in Aid has been awarded to me so that I may enroll in and complete the echo $row["course"];.' );
}
就你而言:
$myVar = "student";
$myString = "The {$myVar} are good.";
它不会打印学生的名字。它打印这一行“$row[“student_name”];”,您不能像这样在字符串中回音,您需要对其进行压缩<代码>'string'$变量更多字符串“可能重复感谢我终于做到了,他感谢你的帮助。我用过concatYep,看起来现在可以用了。
$con = mysqli_connect("localhost","root","","final_osa");
$sel_query="SELECT * FROM ched_scholars WHERE id = '".$_GET['id']."';";
$result = mysqli_query($con,$sel_query);
while($row = mysqli_fetch_assoc($result)) {
$pdf->Write( 6, 'I, {$row["student_name"]}, of legal age and a resident of {$row["present_address"]} understand that an Educational Scholarship/Financial Grants-in Aid has been awarded to me so that I may enroll in and complete the {$row["course"]}.' );
}