Jump to content

Vizionz

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Vizionz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php if ($this->item->type == 'demo') : ?> <div class="demo"><?php echo $this->renderer->render('item.demo.full', array('view' => $this, 'item' => $this->item)); ?></div> <?php else: ?> <div class="item"><?php echo $this->renderer->render('item.full', array('view' => $this, 'item' => $this->item)); ?></div><?php endif; ?> now how would i add another class to show <?php if ($this->item->type == 'demo1') : ?> <div class="demo1"><?php echo $this->renderer->render('item.demo1.full', array('view' => $this, 'item' => $this->item)); ?></div> <?php else: ?> <div class="item"><?php echo $this->renderer->render('item.full', array('view' => $this, 'item' => $this->item)); ?></div><?php endif; ?> how would i combine them into a workking code. so it would check first to see if Demo and demo 1 exist and if not it would dispaly the item.
  2. CREATE TABLE `Artists` ( `ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The unique ID', `Artist` varchar(200) default NULL COMMENT 'The Artist', `ArtistID` varchar(200) default NULL COMMENT 'The Artist Id', `Formed` varchar(200) default NULL COMMENT 'Band Formed', `Picture` varchar(200) default NULL COMMENT 'The band Artist Picture', `Members` text COMMENT 'The Band Members', `Genres` int(4) default '0' COMMENT 'Genre of the artist', `Bio` text COMMENT 'The Biography', `Website` varchar(200) default NULL COMMENT 'The Artists Website', `Myspace` varchar(200) default NULL COMMENT 'The Artists Myspace', PRIMARY KEY (`ID`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; CREATE TABLE `Genres` ( `ID` int(4) unsigned NOT NULL auto_increment COMMENT 'The unique ID of the section', `name` varchar(20) default NULL COMMENT 'The Genre name', `parentid` int(4) default '0' COMMENT 'The ID of the parent section', PRIMARY KEY (`ID`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ; $result = $connector->query('SELECT Artist,Genres,Bio FROM Artists WHERE ID = '.$HTTP_GET_VARS['id']); now as is the last code. that will get me the artist the bio and the genre from the artist table. but i need to take that genre from artist and then take that result and replace it with the relevant row in the genre table. as of now it just gives me the id from the Artists (genres row) i need the name from the genres table so i can echo but dont know how to query that <?php echo $row['Genres'];?> and if you find anything wrong with the way the tables are in mysql please help i am trying to learn to write code and i am novice
  3. 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 ?
  4. 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`) );
×
×
  • 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.