Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About RoyS

  • Rank
  1. I think Rob meant ditch the comma but keep the float cast. If you want to store the data with the comma then strip it out before you use it; simplest method would be to use: $cur_v = str_replace(',', '', $cur_v) or to strip out more characters use preg_replace()
  2. I have now tried implementing this order_contents table. (As an aside I am teaching my grandson – aged 18 – to program and we are working through your text). We tend to create tables by putting the create query into a script, part of which is: sql = "CREATE TABLE order_contents ( order_id INT(10) UNSIGNED NOT NULL, print_id INT(4) UNSIGNED NOT NULL, quantity TINYINT UNSIGNED NOT NULL DEFAULT 1, price DECIMAL(8,2) UNSIGNED NOT NULL, ship_date DATETIME DEFAULT NUL
  3. Dear Larry, I thought you might be interested in my thoughts on your design for the E-Commerce product in your PHP6 and MySql book Normalising the E-Commerce data An invoice for a transaction would include the following fields: TABLE0 order_id, date, cust_id, cust_name,{print_id, print_name, price, size,desc, image, artist_id, artist_name, qty}* The fields in brackets are the repeated order items. This data is not normalised. First Normal Form states: 1. no repeating data 2. each column (field) must be atomic So, separating out the repeats and expanding the names, (PK = Primary
  • Create New...