Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old December 22nd, 2006, 03:59 PM
para para is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 para User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how do they do it(dates)

I noticed this in many websites and I always wondered how they did it

take any website where I have done some things in the past and I need a history like paypal or whatever

they always have something like this:

[date(ex:1/1/2001)] and [action(ex: you bought a tootpick)]

how do they store all those dates for a single customer?

Reply With Quote
  #2  
Old December 22nd, 2006, 04:12 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: how do they do it(dates)

Purchases for each customer are stored in a database along with the date purchased. When that customer is visiting the site, search through the database using his customer id and display the date and name of items he has purchased.

Reply With Quote
  #3  
Old December 23rd, 2006, 11:15 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,933 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 3 Days 23 h 49 m 33 sec
Reputation Power: 3
Orkut
RE: how do they do it(dates)

Yeh they will store some kind of transaction log, similar to a bank statement. Most likely using a timestamp to store the date/time and then formating it with a function similar to the php date() function.

Reply With Quote
  #4  
Old December 23rd, 2006, 11:16 PM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'PHP Coding' to 'Programming Theory' by Andrew.

Reason:

Reply With Quote
  #5  
Old December 27th, 2006, 01:41 PM
para para is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 para User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: how do they do it(dates)

I still don't understand how this could be done with a database
Let's say I have an ecommerce site and my users can buy and sell items. When an user wants to buy something he finds another user that has that and makes him an offer. This user sees the offer and can accept reject or modify it. This is a real world scenario.
Now, when a user logs in he has to be able to view his transactions' history so how could this be saved in a database so as to enable the user to see his transaction history like this:

and so on
1-4-2002 user B accepted your offer
1-3-2002 You modified user B's offer
1-2-2002 user B modified your offer
1-1-2002 You sent an offer to user B

of course I would have a table with the transaction info such as item cost shipping but how would a table look like that could store all those dates from the transaction history?

How could one design such a database?
Which would be the proper database design?

Reply With Quote
  #6  
Old December 27th, 2006, 10:29 PM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 921 IAmALlama User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 17 h 43 m 59 sec
Reputation Power: 2
RE: how do they do it(dates)

I just made this db and this is how I would do it.

Code:
-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Dec 27, 2006 at 03:11 PM
-- Server version: 5.0.24
-- PHP Version: 5.2.0
-- 
-- Database: `test1`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `item_listings`
-- 

CREATE TABLE `item_listings` (
  `listingID` int(10) unsigned NOT NULL,
  `userID` int(10) unsigned NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY  (`listingID`)
) ENGINE=InnoDB ;

-- 
-- Dumping data for table `item_listings`
-- 


Reply With Quote
  #7  
Old December 29th, 2006, 06:08 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,719 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 4 m 29 sec
Reputation Power: 6
RE: how do they do it(dates)

<completely off the top of my head>
maybe make an offer table and a transaction table... offer table links to the 2 customers with any details you may have including a key to link multiple offers on one transaction. transaction could then just have the finalized deals with a link into the offers table to see what happened.
</off the top of my head>

Reply With Quote
  #8  
Old December 29th, 2006, 07:04 AM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 921 IAmALlama User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 17 h 43 m 59 sec
Reputation Power: 2
RE: how do they do it(dates)

oops, I did have 2 tables there when I made it, guess it never exported it when I tried to export them both. this is the whole thing I had:
Code:
-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Dec 28, 2006 at 11:45 PM
-- Server version: 5.0.24
-- PHP Version: 5.2.0
-- 
-- Database: `test1`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `item_listings`
-- 

CREATE TABLE `item_listings` (
  `listingID` int(10) unsigned NOT NULL,
  `userID` int(10) unsigned NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY  (`listingID`)
) ENGINE=InnoDB ;

-- 
-- Dumping data for table `item_listings`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `transactions`
-- 

CREATE TABLE `transactions` (
  `transID` int(10) unsigned NOT NULL,
  `listingID` int(10) unsigned NOT NULL,
  `userID` int(10) unsigned NOT NULL,
  `datetimeOffered` datetime NOT NULL,
  `datetimeExpires` datetime NOT NULL,
  `comment` varchar(255) NOT NULL,
  `offerAmount` decimal(5,2) NOT NULL,
  PRIMARY KEY  (`transID`)
) ENGINE=InnoDB ;

-- 
-- Dumping data for table `transactions`
-- 

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > how do they do it(dates)


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway