Blanke Echo's

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

F. Tack

F. Tack

20/04/2007 10:56:00
Quote Anchor link
Eerste probleem is ondertussen verholpen. Nu krijg ik volgend probleem. Ik heb 2 gesloten Sticky Topics. Nu toond hij er jammer genoeg maar 1. Toch gebruik ik de code om te vragen om 2 of meer lijnen te maken! Op andere pagina's werkt die code perfect, behalve hier! Dit is de volledige code!

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<?
// Checken op errors
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);

// Set variable sticky
$resultOK = 1;

// Verbinden met Database
$sql="SELECT * FROM vraag WHERE Sticky='".$resultOK."' ORDER BY id DESC";
$result=mysql_query($sql)or die(mysql_error());
$checkROWS=mysql_num_rows($result);
$checkLOCK=mysql_fetch_array($result);

$Locked=$checkLOCK['Locked'];

// Check rows is 1 & locked is 0
if ($checkROWS == 1 && $Locked == 0)
 {

?>

<tr>
<td width="6%"><center><img src="../../../images/icons/error.png" alt="STICKY" width="16" height="16"></center></td>
<td width="53%"><a href="topic.php?id=<? echo $checkLOCK['id']; ?>"><font color="black"><? echo $checkLOCK['topic']; ?></font></a></a></td>
<td width="13%"><font color="black"><? echo $checkLOCK['datumtijd']; ?></font></td>
</tr>

<?
 }
// Check rows is 1 & locked is 1
elseif ($checkROWS == 1 && $Locked == 1)
 {

?>

<tr>
<td width="6%"><center><img src="../../../images/icons/exclamation.png" alt="STICKY CLOSED" width="16" height="16"></center></td>
<td width="53%"><a href="topic.php?id=<? echo $checkLOCK['id']; ?>"><font color="black"><? echo $checkLOCK['topic']; ?></font></a></td>
<td width="13%"><font color="black"><? echo $checkLOCK['datumtijd']; ?></font></td>
</tr>
<?
 }
// Check rows bigger than 1 & locked is 0
elseif ($checkROWS > 1 && $Locked == 0)
 {

  while($checkLOCK=mysql_fetch_array($result))
   {

?>

<tr>
<td width="6%"><center><img src="../../../images/icons/error.png" alt="STICKY" width="16" height="16"></center></td>
<td width="53%"><a href="topic.php?id=<? echo $checkLOCK['id']; ?>"><font color="black"><? echo $checkLOCK['topic']; ?></font></a></td>
<td width="13%"><font color="black"><? echo $checkLOCK['datumtijd']; ?></font></td>
</tr>
<?
   }
 }

// Check rows bigger than 1 & locked is 1
elseif ($checkROWS > 1 && $Locked == 1)
 {

  while($checkLOCK=mysql_fetch_array($result))
   {

?>

<tr>
<td width="6%"><center><img src="../../../images/icons/exclamation.png" alt="STICKY CLOSED" width="16" height="16"></center></td>
<td width="53%"><a href="topic.php?id=<? echo $checkLOCK['id']; ?>"><font color="black"><? echo $checkLOCK['topic']; ?></font></a></td>
<td width="13%"><font color="black"><? echo $checkLOCK['datumtijd']; ?></font></td>
</tr>
<?
   }
 }

// None of them, use this
else
 {
?>

<tr>
<td width="6%" height="0"></td>
<td width="53%" height="0"></td>
<td width="13%" height="0"></td>
</tr>
<?
 }
?>

<tr>
<td width="6%" height="5">&nbsp;</td>
<td width="53%" height="5">&nbsp;</td>
<td width="13%" height="5">&nbsp;</td>
</tr>
</table>
Gewijzigd op 01/01/1970 01:00:00 door F. Tack
 
PHP hulp

PHP hulp

16/03/2025 05:36:14
 
Robert Deiman

Robert Deiman

20/04/2007 11:48:00
Quote Anchor link
In principe zetten we dit altijd in een while:

$checkLOCK=mysql_fetch_array($result);

Dus:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?
while($checkLOCK=mysql_fetch_array($result)){
   // hier wat er moet gebeuren, voor elke rij uit je database
   }
?>


Als dit het niet is, snap ik denk ik je vraag niet.
 
F. Tack

F. Tack

20/04/2007 11:52:00
Quote Anchor link
Allright. Daar zat het dus fout. Thx :)
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.