Archívum - Okt 2012 - Fórum téma
Minden adat új dobozba
Sziasztok
Előre is bocsi ha ide írok, igen kezdő vagyok :(
Olyan gondom lenne, hogy van egy friss_hir adatbázisom.
[colorer=php]
<?php
include("connect.php");
include("pagination.class.php");
$query="SELECT * FROM friss_hir ORDER BY id DESC ";
if (req("q_search") != "") {
if (req("q_where") == "-1") {
foreach($f AS $k => $v) {
$where[] ="$k like '%". mysql_real_escape_string( req("q_search")) ."%'";
}
}
else
$where[] = req("q_where") . " like '%". mres( req("q_search") ) ."%'";
}
if(isset($where) AND count($where)>0)
$query .=" WHERE " . implode(" OR " , $where) ;
$result=mysql_query($query);
$num = mysql_num_rows ($result);
$row_per_page=2;
$page= isset($_GET["page"])? intval($_GET["page"]) : 1 ;
$actual=($page-1)*$row_per_page;
$query.=" LIMIT $actual,$row_per_page";
$result = mysql_query( $query ) or die(mysql_error());
if ($num > 0 ) {
?>
<?php
while($a=mysql_fetch_assoc($result))
{
?>
<table width="480" height="362" border="0">
<tr>
<td><table width="480" border="0">
<tr>
<td width="150px"><p class="hir_id"><dfn><?php echo $a["id"]?></dfn></p>
Előre is bocsi ha ide írok, igen kezdő vagyok :(
Olyan gondom lenne, hogy van egy friss_hir adatbázisom.
[colorer=php]
<?php
include("connect.php");
include("pagination.class.php");
$query="SELECT * FROM friss_hir ORDER BY id DESC ";
if (req("q_search") != "") {
if (req("q_where") == "-1") {
foreach($f AS $k => $v) {
$where[] ="$k like '%". mysql_real_escape_string( req("q_search")) ."%'";
}
}
else
$where[] = req("q_where") . " like '%". mres( req("q_search") ) ."%'";
}
if(isset($where) AND count($where)>0)
$query .=" WHERE " . implode(" OR " , $where) ;
$result=mysql_query($query);
$num = mysql_num_rows ($result);
$row_per_page=2;
$page= isset($_GET["page"])? intval($_GET["page"]) : 1 ;
$actual=($page-1)*$row_per_page;
$query.=" LIMIT $actual,$row_per_page";
$result = mysql_query( $query ) or die(mysql_error());
if ($num > 0 ) {
?>
<?php
while($a=mysql_fetch_assoc($result))
{
?>
<table width="480" height="362" border="0">
<tr>
<td><table width="480" border="0">
<tr>
<td width="150px"><p class="hir_id"><dfn><?php echo $a["id"]?></dfn></p>