Jump to content

not showing results


nowuseeme
Go to solution Solved by 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
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.

Edited by nowuseeme
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.