Jump to content

not showing results


nowuseeme

Recommended Posts

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.";
}
Link to comment
https://forums.phpfreaks.com/topic/280209-not-showing-results/
Share on other sites

Do you have error reporting turned on?  What do you get if you do a print_r($data);  Are you sure the query isn't failing?

Hi i have error reporting on im not getting any errors at all, for print_r($data); im also not getting anything the only thing that is showing is (Please enter valid Ticket Number.) and that is showing all the time thanks.

Link to comment
https://forums.phpfreaks.com/topic/280209-not-showing-results/#findComment-1440937
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.