The Deal of the Day Database
Website Automation with PHP and MySQL, Part 7
Low End Mac Reader Specials
Memory To Go Special: New 2008 iMac 2GB $42 / iMac Intel Core2 DUO & MacBook Pro 2GB $36 - 1GB $20. MacPro 8 Core Memory 8GB kit $286 / 4GB kit $143 / 2GB kit $93 -- Free shipping available. LIfetime warranty.
Download Typestyler, still the Ultimate Styling Tool for Internet, Print and Video Graphics. Works great in Classic with a Native OS X Version on the way. Free Tryout: www.typestyler.com
LA Computer Company: Specials on AppleCare, iMac's, Apple Batteries and Apple A/C Adapters. Also Great prices on Used Apple Computers. Call 1-800-941-7654 Click Here.
OWC: Burn DVDs, DVD-DL, CDs, DVD-Ram - FAST! Superdrive upgrades from OWC starting from $31.99 with options for nearly every Mac. Models with Lightscribe, Blu-Ray too!
Mac users can finally play Party Poker for Mac. Not only that, they can also learn how to play PokerStars for Mac.
Laptop Hardware Provided by TechRestore - Overnight Mac & iPod Repairs.
Compare products like desktop computers, laptops, and LCD TVs side by side! All the information and reviews to make the best purchasing decision for a new cell phone GPS products or MP3 players. The Ciao network makes searching products easy for you.
Dan Knight - 2002.05.13
The Deal of the Day database will need several fields:
- ID
- URL
- description
- short description
- extra
- date
The ID will be a unique integer that automatically increments itself. The next four fields will contain text and be of type char, which allows them to be up to 256 bytes long. The date field is the date that the deal should be displayed and will be of type date.
Dates in MySQL
There are many ways to enter dates. Here in the States, most people would write today's date at 5/13/02. In most other English-speaking regions, it would be written 12/5/02. Since the Web is international, that gets confusing in a real hurry.
To address this, Low End Mac began by dating articles like this: 13 May 2002. No confusion, but a mess if you want to sort dates. We later settled on the format YYYY.MM.DD, since it simplifies sorting. It's also an international standard.
While Unix uses a timestamp, that number needs to be converted to years, months, days, hours, minutes, and seconds so we humans can make sense of it. MySQL and PHP also support the YYYY-MM-DD format for dates. Since we're not worried about date stamps and want to make it easy to schedule our Deal of the Day for a specific date, that's the format we'll use.
Creating Six Fields
We've got six fields. After analyzing field lengths from our specials of the day over the past months, we came up with the following:
- ID, just a simply integer that automatically increments
- URL, the URL for the day's special, up to 128 characters long
- text, our long description of the day's special, up to 64 characters
- short, a shorter description for the navigation bar, up to 32 characterss
- extra, used for tracking code required by some affiliate programs, up to 128 characters
- date, the date the special is scheduled to appear, this is also the index field for our database
That gives us a template to pour our data into - except that in this case there isn't a text file or database to import. We'll be adding our Deal of the Day one at a time, so the next project is designing a Web-based front end for editing our database and adding new records.
Recent Online Tech Journal Columns
- Apple's AAUI ethernet connector, 09.04. From 1991 through 1995, Apple used a proprietary ethernet connection. Why they created AAUI and where to find adapters.
- PowerPC G5: Apple's last fling with PowerPC architecture, 05.24. Teaming up with IBM, Apple adopted the PowerPC G5 in 2003 - and phased out the last G5 Power Mac three years later.
- The PowerPC G4: From 350 MHz to 2.0 GHz, 05.24. AltiVec and dual processor support made the G4 a big improvement over the earlier G3 processor.
- The PowerPC G3 story: From 233 MHz to 1.1 GHz, 05.24. The history of the PowerPC 750 family and its use in Apple computers from 1997 through 2004.
- More in the Online Tech Journal index.
Links for the Day
- Mac of the Day: DayStar Genesis, Oct. 1995 - The first 'Mac' with multiple processors, technology Daystar licensed to Apple.
- List of the Day: SuperMacs is for those using Umax SuperMac clones.
- October 6 in LEM history: 98: USB is a good thing - Can Apple save Emailer? - 99: Kihei iMacs - 00: Advice about PDS Power Macs - 03: A replacement PowerBook battery - 04: AirPort Express - 05: The Apple Lisa story - 06: Don't ignore battery recall - Use any networked computer as an additional Mac display
Recent Content on Low End Mac
- Mac Netbook Coming?, $179 64 GB SSD, Apple Owns 20% of US Notebook Market, and More, The 'Book Review, 10.03. Also head of Norton AntiVirus team uses a Mac, Toshiba demos new battery technology, 1 TB notebook drives due in 2010, bargain 'Books from $150 to $2,699, and more.
- Apple Drops iPhone NDA, Defecting to Android, Auto Performance Apps for the iPhone, and More, iNews Review, 10.03. Also more research needed on cellphone cancer link, file sharing app for the iPhone, three new power accessories from Macally, several new iPhone apps, and more.
- Getting the Most from Your G3 Mac, Simon Royal, Mac Spectrum, 10.03. Most G3 Macs can be upgraded so they can run Mac OS X 10.4 'Tiger' quite nicely. Here's how.
- OS X and Safari Shares Grow in September, Toxic Mac Pro?, Green Hard Drives, and More, Mac News Review, 10.03. Also Vista terrible as Mac market grows, CrossOver Mac Pro reviewed, SimpleTech Pro Drives, and a new toolkit for working on computers.
- Best Power Mac G4 and AGP Video Card Deals, Low End Mac Deals, 10.03. Used 450 MHz, $75; 500, $99; 733, $150; 800, $199; 1.25 GHz, C$349; 867 MHz dual, $225; 1 GHz, $349; 1.25, $499; 1.42, $600.
- Best iBook G3 Deals, Low End Mac Deals, 10.03. Used 300 MHz clamshell, $150; 366, $199; 500 CD, $149; 800, $190; 600 CD-RW, $240; 800 Combo, $300; 900, $399; 14" 600, $360; 900, $469.
- Best Mac OS X 10.0-10.3 Deals, Low End Mac Deals, 10.03. Mac OS X 10.0.3, $30; 10.1, $20; 10.2, $60; 10.3 CD, DVD, $100; CD, $119; 10.1 Server, unlimited users, $65; 10.3 Server, unlimited, $150.
- Why I'm Switching from Windows Small Business Server to Leopard Server, Andrew J Fishkin, Best Tools for the Job, 10.02. Windows SBS 2003 has served very well, but with SBS 2008 just around the corner, it's time to reconsider that choice. Leopard Server has a lot to offer.
- The Unwritten Rule Behind Apple's App Store Rejections, Tim Nash, Taking Back the Market, 10.02. "If you want to work with someone, don't attack or try to take over part of what they think of as theirs."
- The Best Browsers for Older Macs Running Tiger, Charles W. Moore, Miscellaneous Ramblings, 10.02. A dial-up user's overview of browsers for Mac OS X 10.4 puts the emphasis on reliability, downloads, and speed.
- CodeWeavers Brings Google's Chrome Browser to Intel Macs, Alan Zisman, Zis Mac, 10.02. Google's new Chrome browser uses separate processes for each tab and brings other changes to Windows users. Now Mac fans can try it as well.
- Best MacBook Deals, Low End Mac Deals, 10.02. Used 1.83 GHz, $649; 2.0 SD, $750; refurb 2.1 GHz, $899; 2.4, $1,099; black, $1,299; new 2.1, $1,019 after rebate; 2.4, $1,204 a/r; black, $1,394 a/r.
- Best iMac G5 Deals, Low End Mac Deals, 10.02. Used 17" 1.6 GHz Combo, $450; 2.0 SuperDrive, $500; 1.9 iSight, $625; 20" 1.8 GHz, $550; 2.0, $600; 2.1 iSight, $650.
- Best iPod touch Deals, Low End Mac Deals, 10.02. Used 1G/8 GB, $160; refurb, $179; new, $198; used 16, $200; refurb, $219; new, $265; refurb 32, $319; new, $345; 2G/8 GB, $229; 16, $280; 32, $380.
- Tiger Great on Old G3 'Books, Maximum RAM for 867 MHz PowerBook G4, and More, Charles W. Moore, Miscellaneous Ramblings, 10.01. Also why 4 GB of RAM in a 32-bit Vista PC wastes most of the last gigabyte and system profile software for Windows PCs.
- Best Intel iMac Deals, Low End Mac Deals, 10.01. Used 17" 1.83 GHz, $625; 20", $599; 2.16, $749; 24", $950; refurb 20" 2.0, $949; 2.4, $999; 2.66, $1,299; 24" 2.4, $1,299; 2.8, $1,549; 3.06, $1,899; rebates on new.
- Best 15" PowerBook G4 Deals, Low End Mac Deals, 10.01. Used 1.25 GHz Combo, $560; 1.33, $580; 1.5, $596;, 1.67 SuperDrive, $690; hi-res, $800.
- Best Apple TV Deals, Low End Mac Deals, 10.01. Refurb 40 GB Apple TV, $199; new, $224; refurb 160 GB, $279; new, $322 - prices include ground shipping.
- More links in our archive.
Go to the Online Tech Journal index.
About LEM | Support | Usage | Privacy | Contacts

