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.
There’s a problem with the
string-literal . variable . string-literalpart of your script.