Matt Ridge Posted November 22, 2011 Share Posted November 22, 2011 My CREATE TABLE list seems not to work... I've used this before or so I thought with no issue. Can anyone here find out what my issue is? I've gone through my books, they look identical... at least in format. So I don't know what I am missing, can anyone see what I've missed? Thanks CREATE TABLE 'ncmr' ( 'id' INT AUTO_INCREMENT, 'Added_By' VARCHAR(80), 'Added_By_Date' DATE 'Nexx_Part' VARCHAR(60), 'Nexx_Part_Description' VARCHAR(90), 'NCMR_Qty' VARCHAR(20), 'JO' VARCHAR(20), 'SN' VARCHAR(20), 'INV' VARCHAR(20), 'Nexx_Inventory_On_Hand' VARCHAR(20), 'Nexx_Inventory_Chk' VARCHAR(20), 'Supplier_Name' VARCHAR(60), 'Supplier_Number' VARCHAR(60), 'Manufacturer_Part_Number' VARCHAR(60), 'Manufacturer_Serial_Number' VARCHAR(60), 'NCMR_ID' VARCHAR(20), 'Nonconformity' MEDIUMTEXT, 'Disposition' MEDIUMTEXT, 'Comments' MEDIUMTEXT, 'CommentsAdditional_Details' MEDIUMTEXT, 'PO' VARCHAR(20), 'PO_Date' DATE, 'Date_Received' DATE, 'ncmrsr' MEDIUMTEXT, 'ncmrsc' MEDIUMTEXT, PRIMARY KEY ('id') ); INSERT INTO ncmr VALUES ( '1', 'Peter Teigeler', '7/7/2011', 'K11205368', '1', 'Assy, CMM Module w/window & Cover', '2', 'I8778', '164', 'N/A', 'N/A', 'Plastic Design Inc', '100255', 'K11205386', 'N/A', 'N/A', '1054', 'Not made to print, missing 2 proximity sensor mouting brackets. These need to be welded in place.', 'Return to vendor for rework, or have vendor come in and rework on site.' ); Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/ Share on other sites More sharing options...
requinix Posted November 22, 2011 Share Posted November 22, 2011 You can't use single quotes for table and field names. Use `backticks` instead. Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290528 Share on other sites More sharing options...
Matt Ridge Posted November 22, 2011 Author Share Posted November 22, 2011 You can't use single quotes for table and field names. Use `backticks` instead. Ok, did what you asked, and still no go. Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290530 Share on other sites More sharing options...
Matt Ridge Posted November 22, 2011 Author Share Posted November 22, 2011 CREATE TABLE `ncmr`( `id` INT AUTO_INCREMENT VARCHAR (11), `Added_By` VARCHAR(80), `Added_By_Date` DATE, `Nexx_Part` VARCHAR(60), `Nexx_Rev`(15), `Nexx_Part_Description` VARCHAR(90), `NCMR_Qty` VARCHAR(20), `JO` VARCHAR(20), `SN` VARCHAR(20), `INV` VARCHAR(20), `Nexx_Inventory_On_Hand` VARCHAR(20), `Nexx_Inventory_Chk` VARCHAR(20), `Supplier_Name` VARCHAR(60), `Supplier_Number` VARCHAR(60), `Manufacturer_Part_Number` VARCHAR(60), `Manufacturer_Serial_Number` VARCHAR(60), `NCMR_ID` VARCHAR(20), `Nonconformity` MEDIUMTEXT, `Disposition` MEDIUMTEXT, `Comments` MEDIUMTEXT, `CommentsAdditional_Details` MEDIUMTEXT, `PO` VARCHAR(20), `PO_Date` DATE, `Date_Received` DATE, `ncmrsr` MEDIUMTEXT, `ncmrsc` MEDIUMTEXT, PRIMARY KEY (`id`) ) INSERT INTO ncmr VALUES ( `1`, `1054`, `Peter Teigeler`, `7/7/2011`, `K11205368`, `1`, `Assy, CMM Module w/window & Cover`, `2`, `I8778`, `164`, `N/A`, `N/A`, `Plastic Design Inc`, `100255`, `K11205386`, `N/A`, `Not made to print, missing 2 proximity sensor mouting brackets. These need to be welded in place.`, `Return to vendor for rework, or have vendor come in and rework on site.` `N/A` `N/A` `N/A` `N/A` `N/A` ); Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290536 Share on other sites More sharing options...
unlishema.wolf Posted November 22, 2011 Share Posted November 22, 2011 you do not have a type defined in a spot.. I added <- HERE to the code for you to see it. CREATE TABLE `ncmr`( `id` INT AUTO_INCREMENT VARCHAR (11), `Added_By` VARCHAR(80), `Added_By_Date` DATE, `Nexx_Part` VARCHAR(60), `Nexx_Rev`(15), <- HERE `Nexx_Part_Description` VARCHAR(90), `NCMR_Qty` VARCHAR(20), `JO` VARCHAR(20), `SN` VARCHAR(20), `INV` VARCHAR(20), `Nexx_Inventory_On_Hand` VARCHAR(20), `Nexx_Inventory_Chk` VARCHAR(20), `Supplier_Name` VARCHAR(60), `Supplier_Number` VARCHAR(60), `Manufacturer_Part_Number` VARCHAR(60), `Manufacturer_Serial_Number` VARCHAR(60), `NCMR_ID` VARCHAR(20), `Nonconformity` MEDIUMTEXT, `Disposition` MEDIUMTEXT, `Comments` MEDIUMTEXT, `CommentsAdditional_Details` MEDIUMTEXT, `PO` VARCHAR(20), `PO_Date` DATE, `Date_Received` DATE, `ncmrsr` MEDIUMTEXT, `ncmrsc` MEDIUMTEXT, PRIMARY KEY (`id`) ) INSERT INTO ncmr VALUES ( `1`, `1054`, `Peter Teigeler`, `7/7/2011`, `K11205368`, `1`, `Assy, CMM Module w/window & Cover`, `2`, `I8778`, `164`, `N/A`, `N/A`, `Plastic Design Inc`, `100255`, `K11205386`, `N/A`, `Not made to print, missing 2 proximity sensor mouting brackets. These need to be welded in place.`, `Return to vendor for rework, or have vendor come in and rework on site.` `N/A` `N/A` `N/A` `N/A` `N/A` ); Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290539 Share on other sites More sharing options...
Matt Ridge Posted November 22, 2011 Author Share Posted November 22, 2011 you do not have a type defined in a spot.. I added <- HERE to the code for you to see it. CREATE TABLE `ncmr`( `id` INT AUTO_INCREMENT VARCHAR (11), `Added_By` VARCHAR(80), `Added_By_Date` DATE, `Nexx_Part` VARCHAR(60), `Nexx_Rev`(15), <- HERE `Nexx_Part_Description` VARCHAR(90), `NCMR_Qty` VARCHAR(20), `JO` VARCHAR(20), `SN` VARCHAR(20), `INV` VARCHAR(20), `Nexx_Inventory_On_Hand` VARCHAR(20), `Nexx_Inventory_Chk` VARCHAR(20), `Supplier_Name` VARCHAR(60), `Supplier_Number` VARCHAR(60), `Manufacturer_Part_Number` VARCHAR(60), `Manufacturer_Serial_Number` VARCHAR(60), `NCMR_ID` VARCHAR(20), `Nonconformity` MEDIUMTEXT, `Disposition` MEDIUMTEXT, `Comments` MEDIUMTEXT, `CommentsAdditional_Details` MEDIUMTEXT, `PO` VARCHAR(20), `PO_Date` DATE, `Date_Received` DATE, `ncmrsr` MEDIUMTEXT, `ncmrsc` MEDIUMTEXT, PRIMARY KEY (`id`) ) INSERT INTO ncmr VALUES ( `1`, `1054`, `Peter Teigeler`, `7/7/2011`, `K11205368`, `1`, `Assy, CMM Module w/window & Cover`, `2`, `I8778`, `164`, `N/A`, `N/A`, `Plastic Design Inc`, `100255`, `K11205386`, `N/A`, `Not made to print, missing 2 proximity sensor mouting brackets. These need to be welded in place.`, `Return to vendor for rework, or have vendor come in and rework on site.` `N/A` `N/A` `N/A` `N/A` `N/A` ); Fixed, and no go still. CREATE TABLE `ncmr`( `id` INT AUTO_INCREMENT, `Added_By` VARCHAR(80), `Added_By_Date` DATE, `Nexx_Part` VARCHAR(60), `Nexx_Rev` VARCHAR(15), `Nexx_Part_Description` VARCHAR(90), `NCMR_Qty` VARCHAR(20), `JO` VARCHAR(20), `SN` VARCHAR(20), `INV` VARCHAR(20), `Nexx_Inventory_On_Hand` VARCHAR(20), `Nexx_Inventory_Chk` VARCHAR(20), `Supplier_Name` VARCHAR(60), `Supplier_Number` VARCHAR(60), `Manufacturer_Part_Number` VARCHAR(60), `Manufacturer_Serial_Number` VARCHAR(60), `NCMR_ID` VARCHAR(20), `Nonconformity` MEDIUMTEXT, `Disposition` MEDIUMTEXT, `Comments` MEDIUMTEXT, `CommentsAdditional_Details` MEDIUMTEXT, `PO` VARCHAR(20), `PO_Date` DATE, `Date_Received` DATE, `ncmrsr` MEDIUMTEXT, `ncmrsc` MEDIUMTEXT, PRIMARY KEY (`id`) ) Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290542 Share on other sites More sharing options...
unlishema.wolf Posted November 22, 2011 Share Posted November 22, 2011 You need to add ,'s to the last couple entries. And then the column count is not correct. Did you forget to add some data? It looks to me like you have 26 columns to enter data and you only enter 22 columns of data. Edit: If you can supply what each field should go into. I can help a little more. Giving you the columns you have blank and making sure the order is correct. Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290544 Share on other sites More sharing options...
mikosiko Posted November 22, 2011 Share Posted November 22, 2011 other than incorrect number of values in the INSERT, also you are using `backticks` for VALUES which is no correct. quoting requinix: You can't use single quotes for table and field names. Use `backticks` instead. Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290565 Share on other sites More sharing options...
unlishema.wolf Posted November 22, 2011 Share Posted November 22, 2011 Yea replace all the `backticks` with 'single quotes' and fix the values you insert (aka you are missing some) and it should work. You may to have reorganize them to insert into the correct columns but it should fix it. Quote Link to comment https://forums.phpfreaks.com/topic/251636-my-create-table-list-seems-not-to-work/#findComment-1290569 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.