How do I add columns into tables in a database?

Discussion in 'MySQL' started by lassie911, Nov 30, 2006.

  1. #1
    I need to do that above, how do I do it? Please give me as much detailed information as you can, I am a newbie.
     
    lassie911, Nov 30, 2006 IP
  2. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #2
    alter table products
    add products_sort_order char(1)


    alter table specials
    add products_sort_order char(1)
     
    kashem, Nov 30, 2006 IP
  3. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #3
    So copy and paste both lines for each one into their tables using "sql"?
     
    lassie911, Nov 30, 2006 IP
  4. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #4

    Yes cope and paste , better you copy one by one
     
    kashem, Nov 30, 2006 IP
  5. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Thanks, will give it a try.
     
    lassie911, Nov 30, 2006 IP
  6. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #6
    Okay, it didn't fix the problem but thanks anyway. Here is the error for this one: http://www.100ebooks.info/index.php?cPath=30 I get simalar errors for different sections and someone suggested the solution I posted.
     
    lassie911, Nov 30, 2006 IP
  7. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #7
    If anyone can help me fix that, i'll send them the same site. Comes with 0ver 100 e-books. Just got it the other day in the buy sell trade section.
     
    lassie911, Nov 30, 2006 IP
  8. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #8
    check whether you have products_id column in products table.
     
    kashem, Nov 30, 2006 IP
  9. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #9
    another thing is what you want fromt the query?

    the query statement seems very confusing to me. It will be helpful if you post all the tables structure here. I think then I can rewrite the sql if I know what you want to find out
     
    kashem, Nov 30, 2006 IP
    lassie911 likes this.
  10. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #10
    lassie911, Dec 1, 2006 IP
  11. vid

    vid Peon

    Messages:
    209
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Why you don't use GUI tool, if you don't know query language just use GUI, it will generate for you. As I've understand you are using MySQL if so then this is a very nice tool for mange it "SQLyog Enterprise".
     
    vid, Dec 2, 2006 IP
  12. fatmagoo

    fatmagoo Peon

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    it's an oscommerce clone and most of the SQL in that app is crap basically.

    This: "select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '30'"

    Uses a mix of old style joins and ANSI "on" clauses - the problem is likely the way the tables are joined and the aias for the products table and the lack of bracketing in the SQL - it looks dodgy to me.
    You might get more advice from the oscommerce forum, although to be honest, most on there don't know much from my experience.
     
    fatmagoo, Dec 2, 2006 IP
  13. lassie911

    lassie911 Well-Known Member

    Messages:
    1,521
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #13
    Thanks for the replies. I got the idea to modify the tables from a oscommerce forum. I agree it's crap! I have just decided that I will not even use it. For those of you who have ALREADY responded in this thread I will send you a copy of this for free if you want it. Here's what it's suppose to look like: http://www.bigfatwebhosting.com/downloadshop/
    Comes with about 100 e-books and you can resell it.
     
    lassie911, Dec 2, 2006 IP