|
Posted by Hilarion on 01/03/06 17:53
> I did save the changes and restarted apache. still to no avail... didn't
> work. so I proceeded w/the book.
It's not a good idea. When you do not have working PHP, then you'll
not be able to run any application. It will not prevent you from using
MySQL itself or Apache itself, but if the book says that you have to
have PHP support installed, then it'll probably sooner or later tell
you to use it.
> the first application example i created was
> a 'guestbook'. So i opened my MySQL command line client and entered my
> password. I then typed create database guestbook; at the prompt. it said
> query ok, 1 row affected.
It does not look like application to me. It looks like creating database
and it's structure. Yes, maybe this database will be used in the guestbook
application, but it's not an application by itself.
> i next typed create table; and it said error 1054 (42000): 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 ' ' at line 1
If it was a good book, then it should describe what does "CREATE TABLE ...."
mean. From it you should know that "CREATE TABLE;" is not a valid SQL
command because you only stated that you want to create table, but did
not provide the table name or structure.
As someone pointed out earlier you should now give command "use guestbook;"
which will inform MySQL that you want to interact with just created guestbook
database (all comands which do not explicitly state database they operate
on will executed since the "use..." statement will operate on that database).
The "CREATE TABLE" statement should have something more before the semicolon.
> so i disregarded the error and kept going..
Which again is NOT a good idea.
> in which i typed use guestbook:
> and it said error 1049 (42000): Unknown database 'guestbook:'
"use guestbook;" should be before the previous "CREATE TABLE" and
should use semicolon as terminating character (not a colon).
> yeah.. so i ignored that too.. lol.
Dont expect something to work if you did not made all the steps
before it.
> and kept going. i typed:
> create table guestbook
> -> (
> -> name varchar(40) null,
> -> location varchar(40) null,
> -> email varchar(40) null,
> -> url varchar(40) null,
> -> comments text null,
> -> )
> -> ;
This "CREATE TABLE" statement is complete: has table name (but should
NOT use same name as database name) and structure.
> and it came up w/another error.. to no suprise.. it said Error 1046 (3D000):
> No database selected.
Because you did not selected the database correctly with "use..." command.
> so here is an idea of where i'm at and what i'm trying to do.
You are performing steps which you do not understand. What is that
dumb book going to teach you if it does not explain what you are doing
and how it's supposed to work?
> but i think it is because of the PHP.. i dunno.
No, it's not. PHP has NOTHING to do with creating database structure.
Yes, you could use PHP application to create it, or use PHP application
which uses the created database structure, but it's not the case.
In this case only thing you need is MySQL server (no Apache or PHP),
but it'll probably change in the further parts of the book.
> help!
Please dump that book or read some tutorials on SQL (and then on PHP)
before you come back to that book.
Hilarion
Navigation:
[Reply to this message]
|