|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hard printing mysql results
I'm looking to enable admin to hard print membership cards for new members on a weekly basis. During the week the admin will validate new members records. In the members table along with members personal details, I have 2 fields, membervalidated and cardprinted. So on day of printing records will be selected on the criteria of
SELECT FROM members WHERE membervalidated='Y' AND cardprinted='N' The results are echoed to screen in the layout of the card ready for printing. I know I could lay things out so the admin user could just use the browsers print function but i would rather have the cards print out automatically once the print cards button is pressed using php if possible. Also after printing all the selected records cardprinted field would have to be updated to 'Y'. Any help will be much appreciated. Thanks. |
|
#2
|
|||
|
|||
|
I don't know if I understood correctly, but here we go:
UPDATE members SET cardprinted = 'Y' WHERE membervalidated = 'Y' AND cardprinted = 'N' Anything else, post another message.
__________________
Regards, Ramiro Varandas Jr. |
|
#3
|
|||
|
|||
|
sorry - my explaining stinks.
Basically, i can get the records i want to print displayed correctly. What I want is to be able to make hard copy prints on a printer of the results and at the same time update cardprinted field of all the records to 'Y' |
|
#4
|
|||
|
|||
|
So, I think that you should use multiple queries, like this:
$sql1 = "SELECT * FROM members WHERE membervalidated = 'Y' AND cardprinted = 'N'"; $query1 = mysql_query($sql1,$connection); $sql2 = "UPDATE members SET cardprinted = 'Y' WHERE membervalidated = 'Y' AND cardprinted = 'N'"; mysql_query($sql2,$connection); if(mysql_num_rows($query1) > 0) { while($rs = mysql_fetch_array($query1)) { print $rs['membervalidated'] . "<br>"; print $rs['cardprinted'] . "<br><br>"; } } else { print "No results"; } |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > hard printing mysql results |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|