Jump to content

Starting out with MySQL


JoeLongstreet

Recommended Posts

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.