Blanke Echo's
Code (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
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
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"> </td>
<td width="53%" height="5"> </td>
<td width="13%" height="5"> </td>
</tr>
</table>
<?
// 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"> </td>
<td width="53%" height="5"> </td>
<td width="13%" height="5"> </td>
</tr>
</table>
Gewijzigd op 01/01/1970 01:00:00 door F. Tack
$checkLOCK=mysql_fetch_array($result);
Dus:
Code (php)
1
2
3
4
5
2
3
4
5
<?
while($checkLOCK=mysql_fetch_array($result)){
// hier wat er moet gebeuren, voor elke rij uit je database
}
?>
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.
Allright. Daar zat het dus fout. Thx :)