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?
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.
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!!
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']); }
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.