Author Topic: i realize how lame this is...  (Read 2441 times)

0 Members and 1 Guest are viewing this topic.

Offline -=harry=-Topic starter

  • Irregular
  • Posts: 8
    • View Profile
i realize how lame this is...
« on: March 29, 2003, 02:03:34 AM »
same old newbie jabber... I\'m just trying to teach my self mySQL and i\'ve run into a problem, i am very sure it is very simple
I have my database, in my database I have tables
I want to add another row to this table.
This is how it currently looks (kinda):
hotchson_com
--->foing_genres
------->genre_id
------->genre_name

This is what I am trying to do:
hotchson_com
--->foing_genres
------->genre_id
------->genre_name
------->artist_id

this is how I am trying to do it

INSERT (
   artist_id smallint(6) NOT NULL default \'0\'
);

it\'s not working... this is not the only statement I have attempted, I have tried many, I\'m just getting kinda tired of seeing the error screen in phpmyadmin.

the only one I had any luck with was

CREATE TABLE  \'artist_id\' (
   smallint(6) NOT NULL default \'0\'
);

but this gave me

hotchson_com
--->artist_id
--->foing_genres

please help its late and I am already balding  :wink:  :roll:                    

Offline metalblend

  • Devotee
  • Posts: 885
    • View Profile
    • http://www.phirebrush.com
i realize how lame this is...
« Reply #1 on: March 29, 2003, 03:08:56 AM »
Do you mean you\'re trying to add another column?
If so, the syntax is like this:
Code: [Select]
ALTER TABLE tbl ADD colName FIELDTYPE;

Hope that helps.                    

Offline -=harry=-Topic starter

  • Irregular
  • Posts: 8
    • View Profile
i realize how lame this is...
« Reply #2 on: March 29, 2003, 09:42:00 AM »
no, I don\'t think so  :oops: but I might be mistaken..  when you say column I think of a verticle column being put into the tabe.  what I want to do is add a row



I want to be able to add a row under

genre_name  varchar(32)   No    

and I need it to be

artist_id smallint(6) Null no Default 0                    

Offline vhkristof

  • Enthusiast
  • Posts: 110
    • View Profile
i realize how lame this is...
« Reply #3 on: March 29, 2003, 10:44:47 AM »
I believe that is what Metalblend is saying ...
The DB columns are shown horizontally in this view ...                    

Offline -=harry=-Topic starter

  • Irregular
  • Posts: 8
    • View Profile
i realize how lame this is...
« Reply #4 on: March 29, 2003, 11:01:48 AM »
ok, cool thanks a lot.
I got it.  :roll:                    

Offline metalblend

  • Devotee
  • Posts: 885
    • View Profile
    • http://www.phirebrush.com
i realize how lame this is...
« Reply #5 on: March 29, 2003, 02:02:28 PM »
8) no problem.