
01-05-2007, 22:58
|
|
|
|
חבר מתאריך: 15.04.06
הודעות: 377
|
|
|
echo אחד מופיע והשני לא, מדוע?
תמונה של הפלט:
[התמונה הבאה מגיעה מקישור שלא מתחיל ב https ולכן לא הוטמעה בדף כדי לשמור על https תקין: http://img390.imageshack.us/img390/5614/twocpusuq4.jpg]
מדוע רק ה next>>> מופיע?
ראו את הקוד:
קוד:
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'censored');
$counter = 0;
$start=0;
$limit = 20;
$end = 20;
$query = mysql_query ("SELECT * FROM users");
$counter=mysql_num_rows($query);
$page_n = $counter/20;
$page_n=intval($page_n)+1;
if($page_n!=0)
{
$page=1;
}
$result = mysql_query('SELECT * FROM users LIMIT ' . $start . ', ' . $end . ';');
if ( mysql_num_rows($query)==0)
{
echo "thers isn't any Users in the database. ";
}
else
{
for (;$row = mysql_fetch_array($result);)
{
$id = $row['ID'];
$users = $row['nickname'];
$gender = $row['Gender'];
$country = $row['country'];
$age = $row['age'];
?>
<table width="600" align="center">
<tr>
<td width="120">
<?php echo($id); ?>
</td>
<td>
<?php echo($users); ?>
</td>
<td width="120">
<?php echo($gender); ?>
</td>
<td width="120">
<?php echo($country); ?>
</td>
<td width="120">
<?php
if($age!=NULL)
{
echo($age);
}
else
{
echo("age=null");
} ?>
</td>
</tr>
</table>
<?php
}
}
echo "there is: $page_n pages.", "<br>";
echo "there is $counter registered users to our website", "<br>";
$prev_page=$page-1;
if($prev_page>=1)
{
echo("<b><<<</b><a href=http://localhost/censored/users_page_test.php?cat=$end&$limit=$limit&$page=$prev_page<b>prev.</b></a><br>");
}// prev_page
$next_page=$page+1;
if($next_page<=$page_n)
{
echo("<b>>>></b><a href=http://localhost/censored/users_page_test.php?cat=$end&$limit=$limit&$page=$next_page<b>next.</b></a>");
}//next_page
mysql_close();
?>
הקטע קוד של ה between של העמודים באמצע מוכן, אך לא הספקתי להכניס אותו עדיין.
_____________________________________
חתימתכם הוסרה כיוון שלא עמדה בחוקי האתר. לפרטים נוספים לחצו כאן. תוכלו לקבל עזרה להתאמת החתימה לחוקים בפורום חתימות וצלמיות.
|