Jump to content

print my mysql fields


ballhogjoni

Recommended Posts

Hi everyone!

I am trying to figure out how to print my database fields to an actual printer.

Basically my mysql database is chalk full of leads that I have collected, and now I want to be able to print these records or leads on a piece of paper in a certain format. I think I can figure out the formatting but I dont know the php code to do this.

Can anyone send me some code or post a link that would teach me how to do this?

thx in advance ;)
Link to comment
Share on other sites

AFAIK, you'd have to generate what you want printed, and actually print it yourself. Such as generate a PDF, then make your computer print it. PHP isn't mean to handle interactions between computers and peripherals, it's a server-side language.
Link to comment
Share on other sites

What?

Select them all out of the database, display them all on the screen like you normally would and print it.
By print, you mean onto paper via a printer, with ink, yes? What I was saying is PHP can't interact with that device.

If you're asking how to get it out of the database, how'd you get it in there in the first place? There are tutorials on databases in the beginners section on this site.
Link to comment
Share on other sites

no no, I can select the fields from my tables into a browser, but thats not what I really want to do.

I want to be able to print each record on a seperate sheet of paper because I have a call center where my sales people sell our product to our leads.

yes its to an actual printer with ink. :D

Link to comment
Share on other sites

[quote]you could possibly output your fields to a browser placing a page break after each record when printed using CSS.[/quote]

How would I do that?

[quote]I would use PHP to generate a PDF file, and print that, that way they can all be on seperate sheets of paper.[/quote]

and how would I do that? any code or link would help.



Link to comment
Share on other sites

if your using a dynamic table to generate each record just assign a css class to it:

[code]
<style type="text/css" media="print">//goes under <title></title>
.break {
page-break-after: always;
}
</style>

<td class="break">
<tr>record</tr>
</td>

[/code]

something like that should do the trick.

something like that
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.