I want to print mysql data which is retrieve from mysql via printer ...
Please donot answer it CTRL + P ...
i want a button which can send all the retrieve data of mysql to printer ... I should be able to print the data via printer ...
Thanks
I want to print mysql data which is retrieve from mysql via printer ...
Please donot answer it CTRL + P ...
i want a button which can send all the retrieve data of mysql to printer ... I should be able to print the data via printer ...
Thanks
This is already answered. Use the solution given in following link:
How to print a page in PHP to print using printer same as window.print() works
The variable $html
variable in this link should contain the data fetched from Mysql(as in your case).
like
$html="<table><tr><td>ID</td><td>Name</td><td>Description</td></tr>";
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT id, name, desc FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$html.="<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td></tr>";
}
$html.="</table>";