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 8408609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:40:49+00:00 2026-06-09T23:40:49+00:00

I have been trying to rack my brains on this one for a while

  • 0

I have been trying to rack my brains on this one for a while and the documentation on both MySQL and MySQLi is confusing me. Would it be possible to get any help?

I have a table called track_table and it contains two rows hash and track

    hash              |  track
    sdfsdfsdfsdfsdfsd |  Azelia Banks - 1991

I want to display the track name but I don’t know how to. I have tried ‘mysqli_fetch_assoc’ and various other functions but nothing. Here is the query I have so far.

    $hash = $_GET['sub'];

    $check_track = "SELECT track FROM track_table WHERE hash = '.$hash.' ";
    $track_res = mysqli_query($mysqli, $check_track) or die (mysqli_error($mysqli));

    $result = mysqli_fetch_assoc($track_res);
    echo $result['track'];

I just want to be able to display the track name on a webpage.

I know I haven’t implemented any security features and I’m taking data straight from the user, I shall do this later, once I have fixed this problem.

  • 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-09T23:40:50+00:00Added an answer on June 9, 2026 at 11:40 pm

    There’s a problem with the string-literal . variable . string-literal part of your script.

    if ( !isset($_GET['sub']) ) {
        die('missing paraemter sub');
    }
    
    $check_track = "
        SELECT
            track
        FROM
            track_table
        WHERE
            hash = '".mysqli_real_escape_string($mysqli, $_GET['sub'])."'
    ";
    $track_res = mysqli_query($mysqli, $check_track) or die (mysqli_error($mysqli));
    
    $result = mysqli_fetch_assoc($track_res);
    if ( !$result ) {
        echo 'no such record';
    }
    else {
        echo $result['track'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to solve this problem for a while, could not find
I have been trying this for a little while nut just cannot get to
Have been trying to fix this problem I have here. Basically I have a
I have been trying to figure this out, but google wasn't turning up any
All this weekend I have been trying to setup a Rails 3.0.4 app in
I have been trying for a while now, but I can't figure out how
I have been trying to connect to mysql all evening using PHP. I know
I have been trying to solve this problem for three days now, it's really
I have been trying to get this to work. Basically I have a search
I have been trying to get this to work for most of the day

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.