Jump to content

Not Getting Any Thing Printed


s4salman

Recommended Posts

Hello

i am getting nothing printed on the page using this code, just a blank page is showing. Can any body help me out from this issue :

 

<?php

if (!ini_get("register_globals")) {
   import_request_variables('GPC');
}
//E?C?? ??I C?E? CEO E?
$phpver = phpversion();
if ($phpver < '4.1.0') {
   $_GET = $HTTP_GET_VARS;
   $_POST = $HTTP_POST_VARS;
   $_SERVER = $HTTP_SERVER_VARS;
}
$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
   $PHP_SELF = $_SERVER['PHP_SELF'];
}

class Pager
  {
   function getPagerData($numHits, $limit, $page)
   {
	   $numHits  = (int) $numHits;
	   $limit    = max((int) $limit, 1);
	   $page	 = (int) $page;
	   $numPages = ceil($numHits / $limit);
	   $page = max($page, 1);
	   $page = min($page, $numPages);
	   $offset = ($page - 1) * $limit;
	   $ret = new stdClass;
	   $ret->offset   = $offset;
	   $ret->limit    = $limit;
	   $ret->numPages = $numPages;
	   $ret->page	 = $page;
	   return $ret;
   }
  }


   // get the pager input values
   $page = $_GET['page'];
   $limit = 50;
   $result = mysql_query("select count(*) from dada where category='Music'");
   $total = mysql_result($result, 0, 0);
   // work out the pager values
   $pager  = Pager::getPagerData($total, $limit, $page);
   $offset = $pager->offset;
   $limit  = $pager->limit;
   $page   = $pager->page;
   // use pager values to fetch data
   $query = "select * from dada order by id DESC category='Music' limit $offset, $limit";
   $result = mysql_query($query);
   $num=mysql_numrows($result);


?>
<?php
$i=0;
while ($i<$num) {
$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$image=mysql_result($result,$i,"image");
$category=mysql_result($result,$i,"category");
$linkdown=mysql_result($result,$i,"linkdown");
$pubsite=mysql_result($result,$i,"pubsite");
$description=mysql_result($result,$i,"description");
$os=mysql_result($result,$i,"os");
echo "<b><u><font size=\"4\">$name</font></u></b><br><font size=\"3\">$description</font><br><a href=\"$pubsite\" rel=\"nofollow\"><font color=\"#060d45\"><b>Publisher WebSite</b></font></a> <a href=\"$linkdown\" rel=\"nofollow\"><font color=\"#060d45\"><b>Download</b></font></a> <hr>";
$i++ ;
}
?>

music.php

Link to comment
https://forums.phpfreaks.com/topic/269482-not-getting-any-thing-printed/
Share on other sites

Your second query statement is malformed. You somehow removed the WHERE keyword and the ORDER BY term comes after the WHERE term.

 

SELECT * FROM your_table WHERE your_where_condition ORDER BY your_order_condition LIMIT $offset, $limit

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.