Thomas,

You don't connect databases to printers.  As you discerned, you could use a
program to query the database and output the results to a printer.

I f you absolutely MUST have it start printing AS SOON as the order is
inserted into the database (and I challenge you to re-think that
requirement) then the PHP script that adds it to the database needs to also
output it to the printer.  This might be the easiest way anyhow.

Sorry, I've never tried to print from PHP so I don't know the specifics but
one possible way to do it would be to open a file handle to your printer and
write to it like it were any other file.  My preference would be to write
the order out to a file and then issue a system command to print that file.

Cal
http://www.calevans.com


-----Original Message-----
From: ThoVer Webproducties [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 7:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Access a printer via PHP


Hello,

For an e-commerce project we want to connect
the mySQL-database we created to a printer
(attached to a computer which has 24h
internet [and mySQL database] access). I
assume it's different to couple the
mySQL-database directly to a printer.
We are however accessing the database via
PHP, so I think it might be possible to send
a command to a printer directly from the PHP
file which puts the data into the database as
well.

We want to do this in order to have an order
via the website printed directly. In fact,
the printer should start printing as soon as
an order is added to the seperate table in
the mySQL database (by a special PHP
document).

Does anyone know whether this is possible
and, if it's possible, could you tell me how?




Thanks in advance,
Thomas.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to