Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4608594
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:52:02+00:00 2026-05-22T00:52:02+00:00

can some one point out the problem with this code? It supposed to fetch

  • 0

can some one point out the problem with this code? It supposed to fetch data from mysql but it returns blank. Here is the full code.

<ul class="list">

<?php

require("object/db.class.php");

error_reporting(0);

function entry_tickets() {

if($_SESSION['dojopress_global:root'] == false) {

$entry_ticket .= <<<ENTRY_TICKET
<li><p><img src="http://cdn1.iconfinder.com/data/icons/humano2/32x32/apps/gnome-keyring-manager.png" />Access denied</p></li>
ENTRY_TICKET;

} elseif($_SESSION['dojopress_global:root'] == true) {

$q = "SELECT * FROM `notice` ORDER BY nid LIMIT 12 DESC";
$r = mysql_query($q);

if ( mysql_num_rows($r) == 0 ) {

$entry_ticket .= <<<ENTRY_TICKET
<li><p><img src="http://cdn1.iconfinder.com/data/icons/humano2/32x32/status/dialog-information.png" /> Nothing to display</p></li>
ENTRY_TICKET;

} elseif ( $r !== false && mysql_num_rows($r) > 0 ) {
    while ( $a = mysql_fetch_array($r) ) {

        $nid = stripslashes($a['nid']);
        $note = stripslashes($a['note']);
        $type = stripslashes($a['type']);
        $private = stripslashes($a['private']);
        $date = stripslashes($a['date']);
        $author = stripslashes($a['author']);


    function note_type($type) {

       if($type == 1) { $type = "posted a comment!"; } elseif($type == 2) { $type = "raised a support ticket!"; } else { }
       return ($type);
    }

$entry_ticket .= <<<ENTRY_TICKET
<li><p><a href="viewer.php?nid=$nid" id="record-$nid"> $athor, note_type($type)</a></p></li>
ENTRY_TICKET;

    return $entry_ticket;

    }
}


}
}

echo entry_tickets();

?>

</ul>

<div style="clear:both;height:10px;"></div>

sorry forgot db.class.php

<?php
session_start();
//connect.php
$host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "au";

$connectClass = mysql_connect("$host", "$db_user", "$db_pass") or die ("Couldn't establish connection to database server.");
$dbObject = mysql_select_db("$db_name", $connectClass) or die ("Couldn't select database.");
?>

error reporting disabled error code

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\wamp\www\ageis\note.php on line 22
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:52:03+00:00Added an answer on May 22, 2026 at 12:52 am

    Your mysql syntax looks bad. You have:

     SELECT * FROM `notice` ORDER BY nid LIMIT 12 DESC
    

    try

     SELECT * FROM `notice` ORDER BY nid DESC LIMIT 12
    

    Erik’s comments should have pointed you in the right direction, however:

    1. Figure out where PHP logs errors. Either turn up php’s error reporting level so you see more errors, or start tailing your apache error_log
    2. You should always check for errors after running mysql_query and do some sort of logging on failure. This is probably best accomplished by writing a wrapper function for mysql_query that does this, or using a 3rd party db wrapper that has already solved this problem.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i know this is kinda retarded but I just can't figure it out. I'm
Two questions: Can someone point me to unbiased data that compares .NET performance to
Can you someone please point in me in a direction, sample code or an
Can some one specify the windows API, one need to use in order to
Can some one post an example of using syslog outputter for log4r, I am
I need some help figuring out a solution to a z-index problem with ie7.
Can someone point me in the right direction? I wish to distribute a WCF
Can someone point me to a public domain (or MIT- or BSD-license) library for
Can someone point me to an article (or discuss here) that explains how an
Can someone please point me to the easiest way to have a timer in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.