Im new to PHP MySQL. Im developing a songbook site.
I\'m trying to pull data in a database from the ID in the URL site/publicsong.php?id=12
.
<
So I will stick to what you already have with some fixes.
connect_error){
die("Connection failed: " . $conn->connect_error);
}
$id = $_GET['id'];
$id = mysqli_real_escape_string($conn,$id);
$query = "SELECT * FROM `lyrics_a` WHERE `id`='" . $id . "'";
$result = mysqli_query($conn,$query);
while($row = mysqli_fetch_array($result)) {
echo "
";
echo $row['id'];
echo $row['eng_title'];
echo $row['eng_lyrics'];
echo $row['alphabet'];
}
?>