开发者

Can php code execute while creation of pdf using tcpdf?

I m working on module in which i have to make pdf from php page. I m Using tcpdf for that but m facing one problem that file contain some mysql queries and php coding which is not executed by pdf page.

$prn_no = $_POST['prn_no'];

$current_sem = $_POST['current_sem'];

$qr_fetch_sem_res_id = mysql_query("SELECT * FROM table1 WHERE ((prn='$prn_no') AND (semisterName='$current_sem'))")or die(mysql_error());

    $qr_fetch_sem_result_ans = mysql_fetch_array($qr_fetch_sem_res_id);

  <tr>
    <td colspan="11" align="left" valign="middle">Programme Name:&nbsp;<?php echo $qr_fetch_sem_result_ans['programme_name'];?></td>
  </tr>
  <tr>
    <td colspan="11" align="center" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="27%">Seat No.: <?php echo $qr_fetch_sem_result_ans['seatNo'];?></td>
        <td width="3%">&nbsp;</td>
        <td width="22%">PR No. : <?php echo $qr_fetch_sem_result_ans['prn'];?></td>
        <td width="2%">&nbsp;</td>
        <td width="17%">Semester : <?php echo $qr_fetch_sem_result_ans['semisterName'];?></td>
        <td width="1%">&nbsp;</td>
        <td width="25%">Month / Year Of Exam : <?php echo $qr_fetch_sem_result_ans['month_year_of_exam'];?> </td>
        <td width="3%">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3">Name: <?php echo $qr_fetch_sem_result_ans['student_name'];?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="7">College / Institute: <?php echo $qr_fetch_sem_result_ans['institute_name'];?></td>
        <td>开发者_Go百科;&nbsp;</td>
      </tr>
    </table></td>
  </tr>


I'm going to go out on a limb here and suggest that you run your queries fist and then build your pdf file. If you run the queries after you build the pdf then of course it will not have access to your data. If that doesn't help then I must not understand what you're asking.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜