Problem Importing SQL File

Discussion in 'MySQL' started by belgin fish, May 10, 2009.

  1. #1
    Hey, well I'm making an arcade and I'm having troubles importing the game data into my database from the sql file.

    This is what im getting.

    Error

    SQL query:

    INSERT INTO `games` ( `gId` , `gInCategory` , `gSwfFile` , `gName` , `gOrder` , `gVisible` , `gThumb` , `gWidth` , `gHeight` , `gDescription` , `gplays` , `description2` , `des2` , `filetype` )
    VALUES (
    '', 56, '1.swf', 'Acne Be Gone', 0, 1, '1.png', 500, 400, 'Pop as many zits and pimples as you can before the timer hits zero.', 0, '', '', 1
    );

    MySQL said: Documentation
    #1054 - Unknown column 'filetype' in 'field list'




    Anyone got any ideas?
     
    belgin fish, May 10, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Not positive but I bet if you look at the table structure you will either find that filetype does not exist or if it does it is set to varchar.

    If it does not exist simply reinstall the tables or add it manually (as a numeric value if that is what the script needs.

    If it there as a varchar the last value needs to be in single quotes '1'. You would need to change this for every record.

    Best course is to ask the peson who created the dump for you.
     
    Colbyt, May 10, 2009 IP
  3. belgin fish

    belgin fish Well-Known Member

    Messages:
    1,544
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    2
    #3
    ok, thanks, but in php my admin i dont see an option to set a row as a numeric value.

    Ok, i just added it as a small int and i think everythings starting to work!!
     
    belgin fish, May 10, 2009 IP
  4. belgin fish

    belgin fish Well-Known Member

    Messages:
    1,544
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    2
    #4
    ok, now i have another small issue. On my site http://www.mp3egg.com/arcade in the lower left hand corner where it says total games its not being very accurate, It saying there is 4,739 games in total, but in the admin panel it says there is 7110 games. Why are they different?

    this is the script :

    // Fix Category Count
    $mcats = mysql_query("SELECT cId FROM mcategories");
    while ($mcat = mysql_fetch_array($mcats)) {
    $mcount = 0;
    $cats = mysql_query("SELECT cId FROM categories WHERE mcid=".$mcat['cId']);
    while ($cat = mysql_fetch_array($cats)) {
    $count = mysql_result(mysql_query("SELECT COUNT(*) FROM games WHERE gInCategory=".$cat['cId']), 0);
    mysql_query("UPDATE categories SET gamesnumber = '".$count."' WHERE cId=".$cat['cId']);
    $mcount = $mcount + $count;
    }
    mysql_query("UPDATE mcategories SET gamesnumber = '".$mcount."' WHERE cId=".$mcat['cId']);
    }
     
    belgin fish, May 10, 2009 IP
  5. brightknight

    brightknight Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Look at the math and see if it makes sense. First you might want to see where the admin panel is getting its count from.
     
    brightknight, May 12, 2009 IP
  6. hostcoin

    hostcoin Peon

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can use mysql_num_rows() to find number of records for the particular value.
     
    hostcoin, May 13, 2009 IP
  7. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #7
    its mean 'filetype' column does not exist in 'games' table

    first check your games table
     
    sunnyverma1984, May 13, 2009 IP