Hello there. I’m following this book through for the third time (I’m a slow learner)., and have run into a little error.
I’m around page 99, where Kevin describes setting up a new schema (ijdb), and then a new table (joke), and then inserting some entries:
INSERT INTO joke
(joketext, jokedate) VALUES (
"A programmer was found dead in the shower. The instructions read: lather, rinse, repeat.",
"2017-06-01")
this produces an error for me Error Code: 1046. No database selected
I’ve done some searching in these forums and if I do the following
USE ijdb;
INSERT INTO joke
(joketext, jokedate) VALUES (
"A programmer was found dead in the shower. The instructions read: lather, rinse, repeat.",
"2017-06-01")
or
INSERT INTO ijdb.joke
(joketext, jokedate) VALUES (
"A programmer was found dead in the shower. The instructions read: lather, rinse, repeat.",
"2017-06-01")
Then both work.
So I’m wondering firstly why it is necessary for me to explicitly select the database but it wasn’t for Kevin?
And secondly, will I have to follow this procedure when connecting via PHP later in the book?