Home » Php » printing PDF File using TCPDF

printing PDF File using TCPDF

Posted by: admin October 26, 2017 Leave a comment

Questions:

Hello I have a problem with printing a pdf file using a query.
I get this error :

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in 
/storage/ssd2/960/1390960/public_html/Hadir/reportAbsence.php:130 Stack trace: 
#0 /storage/ssd2/960/1390960/public_html/Hadir/reportAbsence.php(340): PDF-
>connect('localhost', 'ffffff', 'ddddd', 'ssssss') #1 {main} 
thrown in /storage/ssd2/960/1390960/public_html/Hadir/reportAbsence.php on 
line 130

when I check the php file
I find this command in line :130

  function connect($host='localhost',$username='id1390960_test',$passwd='a12345',$db='id1390960_test') 
 { 
$this->conn = mysql_connect($host,$username,$passwd) or die( mysql_error() ); 
mysql_select_db($db,$this->conn) or die( mysql_error() ); 
mysql_set_charset("utf8");
return true; 
} 

I don’t know why this error occurs. Do you have any idea why this error appears.
One more thing. The file is supposed to print a pdf file.

Answers: