Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

not showing results

$
0
0

hey guys,

anyone have any idea why i cant get my code to show the results when i click submit?

thanks.

<?php
require("db.php");
$data = array();
if(!empty($_GET['term']))
{
    $query = "SELECT department, subject, message FROM supporttickets 
              WHERE ticketnumber = ?";
    $stmt = $db->prepare($query);
    $stmt->execute(array($_GET['term']));
    $data = $stmt->fetchAll();
}

foreach ($data as $row)
{
    echo htmlspecialchars($row['department']);
}
if (!$data)
{
    echo "Please enter valid Ticket Number.";
}

Viewing all articles
Browse latest Browse all 13200

Trending Articles