tags:

views:

62

answers:

4

Is there a php code that printing? I was searching in google but the result is the print function. Or any ideas, or any web prog. langguage that you can share. I need a code to print a list of subjects from my database. Sorry for this stupid question. I don't know if that is possible.

Thanks in advance.

A: 

It's a little but unclear what you mean? You can use a SQL query to get information from a database, and then use echo to print it out. Is that what you mean?

Alex Zylman
preview it in a webpage then print in a paper. is that possible? thank you for answering.
Jordan Pagaduan
If you do what I said, you should just be able to print the resulting webpage. That is, you'll use SQL to retrieve the values, and use PHP's echo function to write them onto the page. You should be able to view the webpage and, if you want to, print out the webpage just like you would any webpage.
Alex Zylman
A: 

don't now about php, but javascript do it for sure, so checkout this and then get back.

Centurion
+3  A: 

If you are talking about a web application, you can bring up the print dialog box with JavaScript using the window.print() function.

Without using activex or other such trickery, there is no way to automatically send something to the printer.

This is a good thing, imagine a malicious web site printing thousands of pages on your machine without your consent.

If you are running a command line php that will depend on the operating system.

Byron Whitlock
Thank you so much. :D
Jordan Pagaduan
A: 

If the intention is a print preview, where the user can click an “Print this” button and the server will print the document you can use CUPS if you use a Linux/Apple/BSD server. http://www.cups.org/articles.php?L545+TNews+Q