[PHP/SQL] blijft bij page 1

Pagina: 1
Acties:
  • 32 views sinds 30-01-2008

  • ReseTTim
  • Registratie: Juni 2000
  • Laatst online: 07-05 12:06

ReseTTim

Chocolate addicted

Topicstarter
ik ben bezig met een script waarin mensen bij de sessie foto's een reactie kunnen achter laten.. tot zo ver is dat niet moeilijk. nu zit mijn probleem bij het opnumeren van de pagina's... $page blijft altijd 1.. :( ik heb al een aantal fouten eruit gehaald waar ik ffies niet op had gelet maar toch nogsteeds werkt het niet..

link van de pagina
owja dit script word geinclude door die tryout_casemods.php...

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$fotoscriptid = $_GET['id'];

if(is_numeric($fotoscriptid)) { 

  $cquery = "SELECT * FROM $dbtable1 WHERE fotoscriptid='$fotoscriptid' order by reactieid DESC"; 
  $count_result = mysql_db_query($dbname, $cquery); 

  $count_qry = "SELECT Count(reactieid) AS Total FROM $dbtable1 WHERE fotoscriptid='$fotoscriptid'"; 
  $count_res = MYSQL_DB_QUERY("$dbname", $count_qry) Or die ("Code: $type \n\n Fout bij Total-Count: ".MYSQL_ERROR()); 
  $count     = MYSQL_FETCH_ARRAY($count_res); 

echo $header4 ; 
  echo ($count["Total"])."<br />"; 
  
 if(!isset($blaat)) { 
 $blaat = 0; 
 }  
 
 $start = $ppp * $blaat; 
 if($start == 0) { 
 echo "<< $header5 &nbsp;|&nbsp;"; } 
 elseif($start >= $ppp=$ppp) { 
 echo "<a href=\"".$PHP_SELF."?id=".$fotoscriptid."&page=".($blaat-1)."\" target=\"_self\" class=\"link\"> 
<< $header5</a> &nbsp;|&nbsp"; } else{ } 

 $temp =  ($blaat*$ppp)+$ppp; 
 $tempquery = "SELECT * FROM $dbtable1 WHERE fotoscriptid='$fotoscriptid' order by reactieid DESC LIMIT $temp,$ppp"; 

 $rijen = @mysql_num_rows(mysql_query($tempquery)); 
 if($rijen >0){ 
 echo "<a href=\"".$PHP_SELF."?id=".$fotoscriptid."&page=".($blaat+1)."\" target=\"_self\" class=\"link\">$header6 >></a><br /><br />"; 
 } 
 

 $rquery = "SELECT * FROM $dbtable1 WHERE fotoscriptid='$fotoscriptid' ORDER BY reactieid DESC LIMIT $start,$ppp"; 
 $reactieresult = mysql_db_query($dbname, $rquery); 

if ($reactieresult) { 

    while ($r = mysql_fetch_array($reactieresult)) 
        { 
            $fotoscriptid  = $r["fotoscriptid"]; 
            $naam  = $r["naam"]; 
            $date = date ("H:i d-m-y", $r['date']); 
            $bericht1  = $r["bericht"]; 
            $bericht1 = ubb($bericht1); 

$bericht = wordwrap( $bericht1, 65, "\n", 1); 
$bericht = stripslashes($bericht); 
$naam = stripslashes($naam); 

echo "<div id=\"reactiesnaam\">". $naam ." | ".$date."</div>\n";
echo "<div id=\"reactiesbericht\">".$bericht. "</div><br />\n";

Mijn profiel - Te koop: Overzicht van spullen..


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

Hmm, wat een codebrei. :P Ik zie een paar dingen die me opvallen. Om te beginnen regel 15: if (isset($blaat)). Waar komt $blaat vandaan? Waar haal je $_GET['page'] vanaf? * NMe gokt op een probleem dat te maken heeft met deze FAQ:
P&W FAQ - PHP: gebruik van superglobals

Omdat het niet te bedoeling is dat wij lappen code voor je gaan debuggen, doe ik dit topic op slot. :)
P&W FAQ - De "quickstart"
P&W FAQ - Leer **** debuggen!!

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Dit topic is gesloten.