Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result reso
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/nousie/domains/osted.net/public_html/topics.php on line 29
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
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
<?
include("config.php");
if(isset($_GET['categorie'])){
$sql = "SELECT * FROM topics ORDER BY datum WHERE categorie = ".$_GET['categorie'];
$res = mysql_query($sql);
echo "<b>Topic overzicht</b><p>";
echo '<table border="1" width="726" height="84" cellspacing="1" cellpadding="0" bordercolor="#800000">
<tr>
<td height="43" width="321">
<p align="center">Titel:</td>
<td height="43" width="123">
<p align="center">Door:</td>
<td height="43" width="168">
<p align="center">Op:</td>
<td height="43" width="54">
<p align="center">Reacties:</td>
</tr>';
while ($row = mysql_fetch_array($res))
{
// het aantal reacties weergeven
$nsql = "SELECT tid FROM replys WHERE tid = '" . $row[id] . "'";
$nres = mysql_query($nsql);
$msg = mysql_num_rows($nres);
$row['datum'] = substr($row['datum'], 0, 10);
echo '<tr>
<td height="43" width="321">
<a href="replys.php?id='. $row['id'] . '">' . $row['titel'] . '</a>
</td>
<td height="43" width="123">
' . $row['naam'] . '
</td>
<td height="43" width="168">
' . $row['datum'] . '
</td>
<td height="43" width="54">
' . $msg . '
</td>
</tr>';
}
echo '</table>';
}
else{
echo'je hebt geen toegang hiernaar';
}
?>
include("config.php");
if(isset($_GET['categorie'])){
$sql = "SELECT * FROM topics ORDER BY datum WHERE categorie = ".$_GET['categorie'];
$res = mysql_query($sql);
echo "<b>Topic overzicht</b><p>";
echo '<table border="1" width="726" height="84" cellspacing="1" cellpadding="0" bordercolor="#800000">
<tr>
<td height="43" width="321">
<p align="center">Titel:</td>
<td height="43" width="123">
<p align="center">Door:</td>
<td height="43" width="168">
<p align="center">Op:</td>
<td height="43" width="54">
<p align="center">Reacties:</td>
</tr>';
while ($row = mysql_fetch_array($res))
{
// het aantal reacties weergeven
$nsql = "SELECT tid FROM replys WHERE tid = '" . $row[id] . "'";
$nres = mysql_query($nsql);
$msg = mysql_num_rows($nres);
$row['datum'] = substr($row['datum'], 0, 10);
echo '<tr>
<td height="43" width="321">
<a href="replys.php?id='. $row['id'] . '">' . $row['titel'] . '</a>
</td>
<td height="43" width="123">
' . $row['naam'] . '
</td>
<td height="43" width="168">
' . $row['datum'] . '
</td>
<td height="43" width="54">
' . $msg . '
</td>
</tr>';
}
echo '</table>';
}
else{
echo'je hebt geen toegang hiernaar';
}
?>
moet zijn
SELECT * FROM topics WHERE categorie = ".$_GET['categorie']." ORDER BY datum