Jump to content


  • Posts

  • Joined

  • Last visited

About damju87

  • Birthday 10/02/1987

Previous Fields

  • Languages
    HTML, CSS, PHP (Learning)

Profile Information

  • Location
    Little Rock, AR

damju87's Achievements


Newbie (1/7)



  1. 1st code is the album. It works when by clicking on a album which will bring up this: //initialize some vars$albumID = '';$album = '';//$songAlbum = $albumName; //check what photo we are looking forif(isset($_GET['id'])){ $albumID = mysql_real_escape_string($_GET['id']); //get the photo $sql = mysql_query("SELECT * FROM albums WHERE albumID='$albumID' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $albumName = $row['albumTitle']; $albumpic = $row['albumpic']; $performer = $row['performer']; $albumtype = $row['type']; $titletrack = $row['titletrack']; $genre = $row['genre']; $releasedate = $row['releasedate']; $distributor = $row['distributor']; $albumtest .= ' <div id="content"> <div id="name">' . $albumName . '</div> <div id="photo"> <img src="../images/albums/album_th/' . $albumpic . '.jpg" /> </div> <ul class="clearfix"> <li> <span class="title">Performer (s)</span> <span class="data">' . $performer . '</span> </li><li> <span class="title">Type</span> <span class="data">' . $albumtype . '</span> </li><li> <span class="title">Title Track</span> <span class="data">' . $titletrack . '</span> </li><li> <span class="title">Genre</span> <span class="data">' . $genre . '</span> </li><li> <span class="title">Release Date</span> <span class="data">' . $releasedate . '</span> </li><li> <span class="title">Distributor</span> <span class="data">' . $distributor . '</span> </li></ul> </div> '; }}else{ $albumtest = "There are no available albums at this time!";} Second is the songs. It finds all the tracks from the album and places them in order. // Get all the data from the "example" table$result = mysql_query("SELECT * FROM songs WHERE album='Agia 1st Album' ORDER BY tracknum")or die(mysql_error());echo "<ol>";// keeps getting the next row until there are no more to getwhile($row = mysql_fetch_array( $result )) {// Print out the contents of each row into a tableecho "<li>";echo $row['songTitle'];echo "</li>";}echo "</ol>"; My problem is combining them into one. I want when the album is selected, the page is displayed with album information and tracklist.
  2. I am using phpMyAdmin and currently having trouble trying to make a foreign key. table album - soloID -> table solo artist - id Already tried: Indexing soloID Different sites: youtube, stackoverflow...etc After searching, I have found nobody actually made a detailed tutorial on how to make a foreign key for somebody who already created tables. Hopefully, somebody can help me here.
  3. Thanks. I'll try that.
  4. At the top of my page, I have: <?php//connect to dbinclude "MyConnect.php";// $artist = $_GET['Mia'];?> Inside the "MyConnect" is: //get all of the photos$photoList = "";$artist = $_POST['artist'];$sql = mysql_query("SELECT * FROM $artist ORDER BY photoID DESC LIMIT 6");//check for photos$photoCount = mysql_num_rows($sql); if ($photoCount > 0){ while($row = mysql_fetch_array($sql)){ $photoID = $row["photoID"]; $photoName = $row["photoName"]; $photoList .= '<li class="thumb"> <a href="#"><img src="../images/mia/' . $photoName . '.jpg" alt="' . $photoName . '" width="100" height="100" /></a> </li>'; }}else{ $dynamicList = "There are no photos at this time!";} What I'm trying to do is, set $artist to equal Mia which will make FROM $artist into FROM Mia. I want to repeat this on more pages.
  5. damju87

    PHP Loops

    I tried the different ones already. If condition is true, execute <td>['field']</td> Then if I have more data in the database added, it should create more <td>['field']</td> When it reach a limit per row, it will create a new row. Repeat 1-3.
  6. damju87

    PHP Loops

    How do I set this kind of loop? First, it fills the cell with the data from the database. <table border="1"><tr><td>Row 1, cell 1</td></tr></table> Then, if there is more data added into the database. <table border="1"><tr><td>Row 1, cell 1</td><td>Row 1, cell 2</td></tr></table> Here's where I want the loop to start. I want it to repeat the process when the row has two cells by creating a new row.
  7. I see these: euckr_korean_ci euckr_bin but none of them are working.
  8. Thanks a lot! It worked! And thanks everybody else who helped me.
  9. So after this: $result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='A.Y'");mysql_close($con);// some code Do I... <? echo ['engname'] ?> When I want to only display one field?
  10. $result = mysql_query("SELECT * FROM djuinfosolo WHERE engname='Agia'");while($row = mysql_fetch_array($result)) { echo $row['engname'] . " " . $row['dateofbirth']; echo "<br />"; }mysql_close($con);// some code?> This is what I have but I'm trying to get it to grab one row without looping. How do I get it where ['engname'] = $engname? So that I will be able to place $engname in a table.
  11. Oops. I forgot to put that. I already have my database and table with the fields. Trying to figure out how to get them to appear in the table.
  12. I'm trying to save a lot of time instead of editing the page everytime. Wouldn't it be easier to just change the information in the database, right? I've been searching for days on how to do it but having no luck. I will be very grateful for the help. Thank you. <table id="data"> <tr> <th scope="row">Occupation</th> <td>Singer</td> </tr> <tr> <th scope="row">Debut</th> <td>December 02, 2011</td> </tr> <tr> <th scope="row">Data of Birth</th> <td>February 13, 1990</td> </tr> <tr> <th scope="row">Record Label</th> <td>Ttakttaguri Entertainment</td> </tr> <tr> <th scope="row">Links</th> <td><a href="http://d2kr.com/hboard3/" target="_blank">Official</a>, <a href="http://blog.naver.com/agia0213">Naver Blog</a>, <a href="https://twitter.com/#!/agia0213">Twitter</a>, <a href="http://me2day.net/agia0213" target="_blank">Me2day</a></td> </tr></table>
  • Create New...