база данных echo в write () fpdf - PullRequest
0 голосов
/ 03 мая 2018
$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"];.' );
}

как я могу повторить имя студента внутри записи ()? спасибо

1 Ответ

0 голосов
/ 03 мая 2018

Попробуйте использовать "{$ var}" внутри вашей строки:

Например:

$myVar = "student";
$myString = "The {$myVar} are good.";

В вашем случае:

$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"]}.' );
}
...