Hey Y’all,
I am having an issue with tying to get card info from my phpMyAdmin database table. It is saying that there is an issue with the variables in my table. “Undefined variable”, even tho there is data in the table on phpMyAdmin. Any help would be grateful. Thanks!
[php]<?php
$page_title = “Card Details”;
require_once (‘includes/header.php’);
require_once (‘includes/database.php’);
//if book id cannot retrieved, terminate the script.
if (!filter_has_var(INPUT_GET, “id”)) {
$conn->close();
require_once (‘includes/footer.php’);
die(“Your request cannot be processed since there was a problem retrieving the card information.”);
}
//retrieve book id from a query string variable.
$id = filter_input(INPUT_GET, “id”, FILTER_SANITIZE_NUMBER_INT);
//MySQL SELECT statement
$sql = “SELECT * FROM marketplace WHERE id=$id”;
//execute the query
$query = @$conn->query($sql);
//Handle errors
if (!$query) {
$errno = $conn->errno;
$error = $conn->error;
$conn->close();
require ‘includes/footer.php’;
die(“Selection failed: ($errno) $error.”);
}
?>
Book Details
|
Name:Pokedex Number:Type:Generation:Price:Description:Illustrator Name: |
<?php echo $row['name'] ?> <?php echo $row['pokedex'] ?> <?php echo $row['type'] ?> <?php echo $row['generation'] ?> <?php echo $row['price'] ?> <?php echo $row['description'] ?> <?php echo $row['illustrator_name'] ?> |
<?php require_once ('includes/footer.php'); [/php]