Искам да направя от 2скрипта 1... но не се получи желания ефект, че ви моля за помощ 
script1:
script2:
А това е което получих аз...
:roll:
script1:
Код:
<?php
include"connect.php";
include"functions.php";
list_categories();
switch($_GET['cat']) {
case"$row[id]";
if(!isset($_POST['$row[id]'])) {
if($_GET['id']) {
$id = (int)$_GET['id'];
$query3 = mysql_query("SELECT * FROM tutorials WHERE valid = '1' AND cat_id = '$id' ORDER BY id DESC");
while($row = mysql_fetch_array($query3)) {
echo"
<table width='100%'>
<tr>
<td width='52'>
<img src='$row[image]' alt=''>
</td>
<td>
<b><a href='viewtut.php?action=view&id=$row[id]'>$row[tutname]</a></b>
$row[shortdes].
Author: <b>$row[authname]</b> | Views: <b>$row[views]</b> | Date: <b>$row[date]</b> |
</td>
</tr>
</table>";
}
}
}
}
?>
Код:
<?php
include"connect.php";
include"functions.php";
if(!isset($_GET['pagenum'])){
$page = 1;
} else {
$page = $_GET['pagenum'];
}
$max_results = 6;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM tutorials"),0);
$total_pages = ceil($total_results / $max_results);
echo "<center><p><br />";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\" class='style3'><<Previous</a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\" class='style3'>$i</a> ";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\" class='style3'>next>></a>";
}
echo "</p></center>";
}
}
}
?>
Код:
<?php
include"connect.php";
include"functions.php";
list_categories();
switch($_GET['cat']) {
case"$row[id]";
if(!isset($_POST['$row[id]'])) {
if($_GET['id']) {
$id = (int)$_GET['id'];
if(!isset($_GET['pagenum'])){
$page = 1;
} else {
$page = $_GET['pagenum'];
}
$max_results = 6;
$from = (($page * $max_results) - $max_results);
$sql = mysql_query("SELECT * FROM tutorials WHERE valid = '1' LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql))
{
echo "<table width='100%'>
<tr>
<td width='1%'>
$row[id]
</td>
<td width='70%'>
<b><a href='viewtut.php?action=view&id=$row[id]' class='style3'>$row[tutname]</a></b> - $row[email]<br><b>$row[shortdes]</b></br>
</td><font color='#FFFFFF'>.</font><td width='18%'>Views: <b>$row[views]</b></td></td> <td width='1%'>
<a href='viewtut.php?action=view&id=$row[id]' class='style3'><img src='$row[image]' alt='Click Here!' width='103' height='80'></a>
</td>
</tr>
</table>";
}
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM tutorials"),0);
$total_pages = ceil($total_results / $max_results);
echo "<center><p><br />";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\" class='style3'><<Previous</a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\" class='style3'>$i</a> ";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\" class='style3'>next>></a>";
}
echo "</p></center>";
}
}
}
?>