Sql query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BenKen
    New Member
    • Jun 2009
    • 8

    Sql query

    Please I am new to php/mysql. I want to create a simple shopping cart with mysql and php but finding it difficult to put together appropriate database queries. I have got six tables. Admin, books, buyers, order_content, order, and images. The tables are displayed below. Is it a normalized database?

    Table image
    imageid
    booksid
    name
    size
    content
    type


    Table order
    order_id
    buyer_id
    total
    order_date


    Table order_content
    ordc_id
    order_id
    bookid
    quantity
    shipdate


    Table buyers
    firstname
    lastname
    buyer_id


    Table Admin
    admin_id
    username
    password


    Table books
    bookid
    bookname
    price
    size
    description

    Pls I would like to have the following functionalities but the queries prove difficult and confusing. Pls help.
    Admin should be able to view transactions, change transaction status and delete products. Buyers should be able to add, update and delete products in shopping cart. Please help.
  • dgreenhouse
    Recognized Expert Contributor
    • May 2008
    • 250

    #2
    Unless you really want to build this for educational purposes, I'd opt to using an existing shopping cart application.

    Your table structure looks pretty normalized, but the shipdate in the order_content table might be a little bothersome. But I do understand why you'd want it there. (i.e. books on back-order, staggered item shipping dates, etc.)

    If this is really something you want to do, you'll need to describe where you're having problems and possibly show a little of your current code.

    Comment

    Working...