Jump to content

PHp/Mysql Novice Needing help


Vizionz

Recommended Posts

Alright i am familiar with php and mysql somewhat but as far as writing my own coding not so much. so i decided to come here and try getting a hand building my own little script and from this i can learn alot through the process.

 

basically i want to create a music artist database. and by doing this this will teach me how to fetch display content and link together different areas in the database with the id so here we go this is what  i need.

 

Artists

----------------------------------------

name

members

formed

genre

biography

picture

website

myspace

----------------------------------------

 

Albums

-------------------------------------

Album title

year

lable

release

description

amazon link

------------------------------------

 

Songs

-----------------------

Artist

Album

Song title

lyrics

----------------------

 

Videos

--------------------

Artist

Album Name

Video Name

Video Info

Video Link

--------------------

 

Fans

----------------

Artist name

 

now basically i have  a basic admin section that allows me to submit articles and stuff that i learned from a cms tutorial now i want to expand from that. so then i can start building a site from what i learn here.

 

so basically i need some help on where to start and how to do some things. first would be

 

for every artist  i want to have everything listed above linked per artist. now if i create different tables in the database.  artist albums  songs  videos  and fans. can i then link every table through a id somehow.  and how would i begin doing this.  remember i am novice so this is all learning so please look this over and if you find better ways to do something please let me know  i want to learn.

 

artist.php?artistid=1  now artist id  1 is neil diamond

 

now i would want that page to show

 

artist name

band members

there biography

a main picture

rate this artist  (this i will need major help with)

a list of links that are the albums titles. (they link to Albums.php?id=1)

a list of fans (limit to ten) and the ability to add or remove this artist as a fan.

 

next would be doing the albums page and pretty much by now i would of learned how to link things and might not need more help  but i will go from there at a later time.

 

To start would that be the right sql to start for the artists

 

CREATE TABLE `articles` (
`ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The unique ID',
`Artist` varchar(200) NULL COMMENT 'The  Artist',
`Formed` varchar(200) NULL COMMENT 'Band Formed',
`Picture` varchar(200) NULL COMMENT 'The  band Artist Picture',
`Members` text NULL COMMENT 'The Band Members',
`Genre` int(4) NULL DEFAULT 0 COMMENT 'Genre of the artist',
`Bio` text NULL COMMENT 'The Biography',
`Website` varchar(200) NULL COMMENT 'The  Artists Website',
`Myspace` varchar(200) NULL COMMENT 'The  Artists Myspace',
PRIMARY KEY (`ID`)
);

 

 

Link to comment
Share on other sites

Hi Vizionz,

 

This sounds like a school assignment...I remember doing something very similar.  Unfortunately we can not just give you the answer :P

 

I will give you a shove in the right direction.  Linking can be easy, but time consuming because of all the different queries on each table.

 

Remember each table will need to relate to each other - make sure that when you make your tables you incorporate the artistid in each table.  That will give you the ability to find what you are looking for in the other tables in regards to a selected artist.

 

I will leave the rest to you :)

Link to comment
Share on other sites

So pretty much every table i make

 

artist

ArtistID

 

Albums

ArtistID

 

Songs

ArtistId

 

And so on

 

since ArtistId needs to be in all the tables. when i have a submit form. can i just have a text Field Thats asks for the artist Id  and then i wout be able to put the artists name ? or will it need to be numeric ?

Link to comment
Share on other sites

I would stick with numeric.  The ID should be unique.  Artists name or something like that would come across duplicates at some point and time.  With mysql the ID can be automatically incremented so there would not be a need for a text field on the form.

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.