Laurent* 1 Posted February 27, 2018 Report Share Posted February 27, 2018 Hey, I need to create a database and tables. I'm using phpmyadmin to do this. According to the professor's Power point slides the code below should create a table however it got me an error. I don't know how to think about this yet so go easy on me please. CREATE TABLE zodiacsigns (Sign VARIABLES(10), President VARIABLES(75)); Quote Error Static analysis: 2 errors were found during analysis. Unrecognized data type. (near "VARIABLES" at position 31) Unrecognized data type. (near "VARIABLES" at position 56) SQL query: CREATE TABLE zodiacsigns (Sign VARIABLES(10), President VARIABLES(75)) MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIABLES(10), President VARIABLES(75))' at line 1 Quote Link to post Share on other sites
justsomeguy 1,135 Posted February 27, 2018 Report Share Posted February 27, 2018 It tells you exactly what the problem is: Unrecognized data type. (near "VARIABLES" at position 31) You can find the list here: https://dev.mysql.com/doc/refman/5.7/en/data-types.html Quote Link to post Share on other sites
Laurent* 1 Posted March 2, 2018 Author Report Share Posted March 2, 2018 I've looked through this and I still don't understand. I don't even what i'm creating honestly. I'm just trying to fix an error. Quote Link to post Share on other sites
Ingolme 1,020 Posted March 2, 2018 Report Share Posted March 2, 2018 The code you presented is trying to create a table with two fields, each of type "VARIABLES," but "VARIABLES" is not a valid data type. My guess is that whoever wrote the query intended to write VARCHAR. 1 Quote Link to post Share on other sites
justsomeguy 1,135 Posted March 2, 2018 Report Share Posted March 2, 2018 I don't even what i'm creating honestly. I'm just trying to fix an error. How can you know if the error is fixed if you don't know what you're creating? 1 Quote Link to post Share on other sites
Laurent* 1 Posted March 9, 2018 Author Report Share Posted March 9, 2018 (edited) I failed this assignment but I thrived in the next one which was worth more. Anyways the professors code examples aren't good and I decided to stop using the resources. This is why I struggled because I thought I needed to use his examples and I had a different SQL with different syntax. I was trying to create a data base named chinese_zodiac. This thread is done. Edited March 9, 2018 by Laurent* Quote Link to post Share on other sites
justsomeguy 1,135 Posted March 9, 2018 Report Share Posted March 9, 2018 The error was because you were trying to tell it to use a data type that does not exist, so I linked you to the list of data types. Hopefully you know what general data type you were trying to store, if it was text or numbers or whatever, and could find an appropriate one in the list. If you don't know what kind of data you're trying to store, the first step is to figure that out. Quote Link to post Share on other sites
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.