JoeLongstreet Posted July 5, 2008 Share Posted July 5, 2008 Hello, This is my very fist post so obviously I am totally new to the subject. I'm working from an O'Reilly book (Learning PHP and MySQL by Michele E. Davis and Jon A. Phillips) and I've come to the section on introducing MySQL. The book tells me to type a chunk of code into the command line client: CREATE TABLE books ( title_id INT NOT NULL AUTO_INCREMENT, title VARCHAR (150), pages INT, PRIMARY KEY (title_id)); CREATE TABLE authors ( author_id INT NOT NULL AUTO_INCREMENT, title_id INT NOT NULL, author VARCHAR (125), PRIMARY KEY (author_id)); And then it gives me this: ERROR 1046 (3D000): No database selected The book doesn't say anything about this so I'm a little confused. I've been writing my PHP in Dreamweaver and everything has been going smoothly. Just need a little help in getting MySQL going. I'm also running Mac OSX 10.4.11 if that makes any difference. Any suggestions? Thanks, Joe Quote Link to comment https://forums.phpfreaks.com/topic/113359-starting-out-with-mysql/ Share on other sites More sharing options...
otuatail Posted July 5, 2008 Share Posted July 5, 2008 You need a database. how are you executing this? do you have phpmyadmin to controll a database. Database have tables and you have to create a table within it. Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/113359-starting-out-with-mysql/#findComment-582428 Share on other sites More sharing options...
JoeLongstreet Posted July 5, 2008 Author Share Posted July 5, 2008 Not entirely sure what your asking since I'm pretty new. I'm executing this through Terminal on a Mac? I don't know what phpmyadmin is and I'm not sure how to create a table. Any chance you could point me in the direction of a tutorial that would help me figure out some of these things? Thanks, Joe Quote Link to comment https://forums.phpfreaks.com/topic/113359-starting-out-with-mysql/#findComment-582449 Share on other sites More sharing options...
wildteen88 Posted July 5, 2008 Share Posted July 5, 2008 Make sure you havn't missed a step in the book (back track a page or two). The book should explain how to select or create a databases before telling you how to create a table. Quote Link to comment https://forums.phpfreaks.com/topic/113359-starting-out-with-mysql/#findComment-582472 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.