Its Time to Connect to the Server
June 23, 2000
OK, now that we all know the basics, its time to connect to the server.
If you have any problems email support, they like answering these
questions.
shell> mysql -h localhost -u joesauto -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 459 to server version: 3.22.20a-log
Type 'help' for help.
mysql>
After successfully connecting to the server we need to access the
database (joesauto) that support created for me. If you don't
have a database yet, now is the time to create one. To see what
databases are on the server type show databases; if your
database is there select it by typing use joesauto. If you
can't access the database contact support. This tutorial could take
days if your support is slow.
mysql> use joesauto
Database changed
mysql>
After alot of
reading I figured out how to create a table for all of the important
data, (year, make, model, price and picture). The picture part took alot
of time to figure out. I found out that it was best to just store the
picture filename in the database and store the actual picture in a
specified directory on my server. Below is what I used to
create the table. (I am sure there are other ways of creating this
table but, this is what worked for me.)
mysql> CREATE TABLE joesauto(
-> year INT(4),
-> make CHAR(20),
-> model CHAR(20),
-> price CHAR(15),
-> picture_name CHAR(25)
-> );
PHP, MySQL and Images
PHP, MySQL and Images
Inserting the Data Into the Database
|