Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:56:35+00:00 2026-06-05T02:56:35+00:00

I’m still learning more interesting details about PHP. Example: Moving from MySQL to MySQLi.

  • 0

I’m still learning more interesting details about PHP. Example: Moving from MySQL to MySQLi. What I am currently doing is trying enter something like this: http://music.daum.net/artist/main?artist_id=2289

From what I learned from pagination by dicing the url:

  • main?
  • artist_id=
  • 2289

How can I be able to make a page like that? I have 2 sections available and will make the others when figuring this out.

  • artist information (available as testhub-artist.php)
  • album (available as testhub-artistalbum.php)
  • music video
  • photo section

I want to make it easier when making pages instead of making separate folders for each person.

My url would be: “../artist/detail?artist_id=#”


This is at the top of the artist page.

<?php
//Connect to ...
include "testhub-artist.php";
include "testhub-artistalbum.php";
?>

testhub-artist.php

<?php
//Connect to database
include "mysqli_connect.php";

// Construct our join query
$sql = "SELECT * FROM individuals WHERE soloID = 1";

// Create results
$result = mysqli_query($link, $sql);

// Checking if query is successful
if($result){

// Print out the contents of each row into a table 
while($row = mysqli_fetch_array($result, MYSQLI_BOTH)){

// If else states on each variable
    if ($profilepic = $row['profilepic']){
        $profilepic = $row['profilepic'];
    }else{
        $profilepic = "DamjuNoImage";
    }
    if ($engname = $row['engname']){
        $engname = $row['engname'];
    }else{
        $engname = "Unknown";
    }
    if ($korname = $row['korname']){
        $korname = $row['korname'];
    }else{
        $korname = "Unknown";
    }
    if ($engbn = $row['engbn']){
        $engbn = $row['engbn'];
    }else{
        $engbn = "Unknown";
    }
    if ($korbn = $row['korbn']){
        $korbn = $row['korbn'];
    }else{
        $korbn = "Unknown";
    }
    if ($dateofbirth = $row['dateofbirth']){
        $dateofbirth = $row['dateofbirth'];
    }else{
        $dateofbirth = "Unknown";
    }
    if ($occupation = $row['occupation']){
        $occupation = $row['occupation'];
    }else{
        $occupation = "Unknown";
    }
    if ($debut = $row['debut']){
        $debut = $row['debut'];
    }else{
        $debut = "Unknown";
    }
    if ($recordlabel = $row['recordlabel']){
        $recordlabel = $row['recordlabel'];
    }else{
        $recordlabel = "Unknown";
    }
    if ($officialsite = $row['officialsite']){
        $officialsite = $row['officialsite'];
    }else{
        $officialsite = "#";
    }
    if ($sitename = $row['sitename']){
        $sitename = $row['sitename'];
    }else{
        $sitename = "Unknown";
    }
} // End of while statement
}else{
    $engname = "Unknown";
    $korname = "Unknown";
    $engbn = "Unknown";
    $korbn = "Unknown";
    $dateofbirth = "Unknown";
    $occupation = "Unknown";
    $debut = "Unknown";
    $recordlabel = "Unknown";
    $officialsite = "#";
    $sitename = "Unknown";
} // End of If statement

// Free result set
//mysqli_free_result($result);

?>

testhub-artistalbum.php

<?php
//connect to db
include "mysqli_connect.php";

//check for a page number. If not, set it to page 1
if (!(isset($_GET['albumpage']))){
    $albumpage = 1;
}else{
    $albumpage = $_GET['albumpage'];
}

//query for record count to setup pagination
$sqli = "SELECT * FROM albums WHERE soloID = 3";
$album_data = mysqli_query($link, $sqli);
$album_rows = mysqli_num_rows($album_data); 

//number of photos per page
$album_pagerows = 4; 

//get the last page number
$last_album = ceil($album_rows/$album_pagerows); 

//make sure the page number isn't below one, or more than last page num
if ($albumpage < 1){
    $albumpage = 1;
}elseif ($albumpage > $last_album){
    $albumpage = $last_album;
}

//Set the range to display in query
$max_album = 'limit ' .($albumpage - 1) * $album_pagerows .',' .$album_pagerows;

//get all of the photos
$albumList = "";
$sqli2 = "SELECT * FROM albums WHERE soloID = 3 ORDER BY releasedate DESC $max_album";
$album_sql = mysqli_query($link, $sqli2);

//check for photos
$albumCount = mysqli_num_rows($album_sql);

if ($albumCount > 0){
    while($album_rows = mysqli_fetch_array($album_sql)){
    $albumID = $album_rows["albumID"];
    $albumpic = $album_rows["albumpic"];
    $title = $album_rows["albumTitle"];
    $releasedate = $album_rows["releasedate"];
    $page = $album_rows["page"];
    $albumList .= '
      <li class="albumthumb">
         <a href="' . $page . '" title="' . $title . '"><img class="profile" src="../albums/album_th/' . $albumpic . '.jpg" alt="' . $albumpic . '" width="120" height="120" border="0" /><p class="datatitle">' . $title . '</p></a><p class="data-releasedate">' . $releasedate . '</p>
       </li>
                  ';
    }
}else{
    $albumList = "There are no available albums at this time!";
}

//mysql_close();
?>

Sorry for not explaining clearly. I want to be able to use pagination when making a profile page like the url. I want to use the number in the url to change the id (soloID) in the sql code.

Good idea in saving time, right? MySQLi getting easier every time I see it.

Thank you.


Changed 5/31/2012 5:44PM CT

$artist = $_GET['artist_id']

into

    if(is_numeric($_GET['artist_id'])){
    $artist = $_GET['artist_id'];
}else{
    $artist = 1;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:56:37+00:00Added an answer on June 5, 2026 at 2:56 am
    artist/detail?artist_id=#
    

    You would use detail as the page, (probably have a detail folder with a index) and on the detail page, have a $_GET[] variable somewhere that gets the artist_id. So your code could look something like this:

    $artist = $_GET['artist_id']; // Filter this variable
    
    $sql = "SELECT * FROM individuals WHERE soloID = '{$artist}'";
    
    /**
     * Verify if the ID exists
     * Display query results, etc.
     */
    

    So everytime you change the artist_id variable in the URL, the page should change accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.