MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 11th, 2003, 03:05 AM
wap wap is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 20 wap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old February 11th, 2003, 08:09 AM
ramz ramz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Juiz de Fora - MG- Brazil
Posts: 93 ramz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to ramz Send a message via MSN to ramz
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.

Reply With Quote
  #3  
Old February 11th, 2003, 12:52 PM
wap wap is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 20 wap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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'

Reply With Quote
  #4  
Old February 11th, 2003, 01:46 PM
ramz ramz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Juiz de Fora - MG- Brazil
Posts: 93 ramz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to ramz Send a message via MSN to ramz
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";
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > hard printing mysql results


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT