Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "123";
  5.  
  6. // Create connection
  7. $conn = mysqli_connect($servername, $username, $password, 'test');
  8.  
  9. // Check connection
  10. if (!$conn) {
  11. die("Connection failed: " . mysqli_connect_error());
  12. }
  13. mysqli_set_charset($conn,"utf8");
  14.  
  15. ;
  16. if ($result = mysqli_query($conn, 'select * from videos'))
  17. {
  18. $row=mysqli_fetch_row($result);
  19. // Free result set
  20. mysqli_free_result($result);
  21. }
  22. mysqli_close($conn);
  23.  
  24. include ("mpdf/mpdf.php");
  25. $mpdf = new mPDF('', 'A4', 14, 'nikosh');
  26.  
  27. $mpdf->WriteHTML('');
  28. $txt = $row[2];
  29.  
  30. $mpdf->multiCell(100, 10, $txt, 1, 'L', 0);
  31. $mpdf->Output('');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement