PHP zoekfunctie in sql
Pagina: « vorige 1 2 3 4 5 volgende »
ok ff testen
http://members.lycos.nl/interfoon/mettoestel.php
hij geeft een fout
Parse error: parse error in /data/members/free/tripod/nl/i/n/t/interfoon/htdocs/result.php on line 214
hij geeft een fout
Parse error: parse error in /data/members/free/tripod/nl/i/n/t/interfoon/htdocs/result.php on line 214
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Debitel Sales Tool - Hoofdpagina</title>
</head>
<body>
<body text="#668014">
<body link="#009ACD">
<body vlink="#556B2F">
<body alink="#009ACD">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
?>
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
?>
<!--DWLayoutTable-->
<tr>
<td height="81" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="81" background="images/ja.jpg"><div align="center">
<h1>Debitel Sales Tool</h1>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="192" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="325" height="602" valign="top" background="images/Company-Boxed_SideBox.jpg"><blockquote>
<p> </p>
<p align="center">Hier vind je de laatste info!<br />
"info"</p>
</blockquote>
</td>
</tr>
</table></td>
<td width="208" height="107" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_01.jpg"><div align="center">
<h2><a href="index.html">Home</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td color="#668014" width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_02.jpg"><div align="center">
<h2><a href="aanbiedingdoen.html">Aanbieding doen</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_03.jpg">
<H2 align="center"><a href="Argumentatie.html">Argumentatie</a></h2>
</td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_04.jpg"><div align="center">
<h2><a href="Toestelinfo.html">Toestel info</a></h2>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="495" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="832" height="495" align="center" valign="top" background="images/Company-Boxed_MainBox.jpg"><div align="center">
<p> </p>
<blockquote>
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
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
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products
//WHERE" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products
//WHERE" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
<p align="left"> </p>
<p align="left"><br />
</p>
<p align="left"></p>
<p align="left"> </p>
</blockquote>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="85" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="85" align="center" valign="bottom" background="images/ja.jpg"><div align="center">
<h5>Copyright (c) 2006 <a href="mailto:[email protected]">Mike</a></h5>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
eerst gaf ie alles weer , nu dus niets
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Debitel Sales Tool - Hoofdpagina</title>
</head>
<body>
<body text="#668014">
<body link="#009ACD">
<body vlink="#556B2F">
<body alink="#009ACD">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
<?php
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
?>
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
?>
<!--DWLayoutTable-->
<tr>
<td height="81" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="81" background="images/ja.jpg"><div align="center">
<h1>Debitel Sales Tool</h1>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="192" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="325" height="602" valign="top" background="images/Company-Boxed_SideBox.jpg"><blockquote>
<p> </p>
<p align="center">Hier vind je de laatste info!<br />
"info"</p>
</blockquote>
</td>
</tr>
</table></td>
<td width="208" height="107" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_01.jpg"><div align="center">
<h2><a href="index.html">Home</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td color="#668014" width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_02.jpg"><div align="center">
<h2><a href="aanbiedingdoen.html">Aanbieding doen</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_03.jpg">
<H2 align="center"><a href="Argumentatie.html">Argumentatie</a></h2>
</td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_04.jpg"><div align="center">
<h2><a href="Toestelinfo.html">Toestel info</a></h2>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="495" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="832" height="495" align="center" valign="top" background="images/Company-Boxed_MainBox.jpg"><div align="center">
<p> </p>
<blockquote>
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
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
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
<p align="left"> </p>
<p align="left"><br />
</p>
<p align="left"></p>
<p align="left"> </p>
</blockquote>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="85" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="85" align="center" valign="bottom" background="images/ja.jpg"><div align="center">
<h5>Copyright (c) 2006 <a href="mailto:[email protected]">Mike</a></h5>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Gewijzigd op 25/01/2006 12:53:00 door Robert Deiman
ff kijken maar maakt hij zo wel connectie met mij database?
zo geeft hij ook geen resultaten weer
Met de hierboven aangepaste code dan? Staat verbindingscode nu wel bij in.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Debitel Sales Tool - Hoofdpagina</title>
</head>
<body>
<body text="#668014">
<body link="#009ACD">
<body vlink="#556B2F">
<body alink="#009ACD">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
?>
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
?>
<!--DWLayoutTable-->
<tr>
<td height="81" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="81" background="images/ja.jpg"><div align="center">
<h1>Debitel Sales Tool</h1>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="192" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="325" height="602" valign="top" background="images/Company-Boxed_SideBox.jpg"><blockquote>
<p> </p>
<p align="center">Hier vind je de laatste info!<br />
"info"</p>
</blockquote>
</td>
</tr>
</table></td>
<td width="208" height="107" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_01.jpg"><div align="center">
<h2><a href="index.html">Home</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td color="#668014" width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_02.jpg"><div align="center">
<h2><a href="aanbiedingdoen.html">Aanbieding doen</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_03.jpg">
<H2 align="center"><a href="Argumentatie.html">Argumentatie</a></h2>
</td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_04.jpg"><div align="center">
<h2><a href="Toestelinfo.html">Toestel info</a></h2>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="495" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="832" height="495" align="center" valign="top" background="images/Company-Boxed_MainBox.jpg"><div align="center">
<p> </p>
<blockquote>
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
87
88
89
90
91
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
87
88
89
90
91
<?php
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] != 'geen voorkeur') {
$voorwaarden = 1;
$and = false;
}
else {
$voorwaarden = "WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = 'WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = 'WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = 'WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
<p align="left"> </p>
<p align="left"><br />
</p>
<p align="left"></p>
<p align="left"> </p>
</blockquote>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="85" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="85" align="center" valign="bottom" background="images/ja.jpg"><div align="center">
<h5>Copyright (c) 2006 <a href="mailto:[email protected]">Mike</a></h5>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
zo staat hij er nu in
Kan iemand ff helpen, ik zie de fout niet :S
en ik zie em al helemaal niet :S
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
en kijk of wel klopt wat hier staat.
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
echo "</query>\n";
zo bedoel je?
echo $sql; bedoel ik ;)
ok ff doen
dit komt er nu bij te staan
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Debitel Sales Tool - Hoofdpagina</title>
</head>
<body>
<body text="#668014">
<body link="#009ACD">
<body vlink="#556B2F">
<body alink="#009ACD">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="81" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="81" background="images/ja.jpg"><div align="center">
<h1>Debitel Sales Tool</h1>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="192" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="325" height="602" valign="top" background="images/Company-Boxed_SideBox.jpg"><blockquote>
<p> </p>
<p align="center">Hier vind je de laatste info!<br />
"info"</p>
</blockquote>
</td>
</tr>
</table></td>
<td width="208" height="107" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_01.jpg"><div align="center">
<h2><a href="index.html">Home</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td color="#668014" width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_02.jpg"><div align="center">
<h2><a href="aanbiedingdoen.html">Aanbieding doen</a></h2>
</div></td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_03.jpg">
<H2 align="center"><a href="Argumentatie.html">Argumentatie</a></h2>
</td>
</tr>
</table></td>
<td width="208" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="208" height="107" align="center" valign="middle" background="images/Company-Boxed_TobBox_04.jpg"><div align="center">
<h2><a href="Toestelinfo.html">Toestel info</a></h2>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="495" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="832" height="495" align="center" valign="top" background="images/Company-Boxed_MainBox.jpg"><div align="center">
<p> </p>
<blockquote>
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
87
88
89
90
91
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
87
88
89
90
91
<?php
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] == 'geen voorkeur') {
$voorwaarden = "";
$and = false;
}
else {
$voorwaarden = " WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = ' WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = ' WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = ' WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
// connect script
$db_host = 'localhost';
$db_user = 'interfoon';
$db_pass = '';
$db_name = 'interfoon_nl_db';
mysql_connect ($db_host, $db_user, $db_pass);
@mysql_select_db ($db_name) or die ('Fout bij het selecteren van de database');
unset ($db_host, $db_user, $db_pass, $db_name);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['merk'] == 'geen voorkeur') {
$voorwaarden = "";
$and = false;
}
else {
$voorwaarden = " WHERE merk LIKE '".$_POST['merk']."'";
$and = true;
}
if (isset ($_POST['camera'])) {
if ($and) {
$voorwaarden = ' AND camera = 1';
}
else {
$voorwaarden = ' WHERE camera = 1';
$and = true;
}
}
if (isset ($_POST['bluetooth'])) {
if ($and) {
$voorwaarden = ' AND bluetooth = 1';
}
else {
$voorwaarden = ' WHERE bluetooth = 1';
$and = true;
}
}
if (isset ($_POST['umts'])) {
if ($and) {
$voorwaarden = ' AND umts = 1';
}
else {
$voorwaarden = ' WHERE umts = 1';
$and = true;
}
}
$sql = "
SELECT merk, model, kort, prijs, link
FROM products" . $voorwaarden;
// hierna je query uitvoeren
}
$result=mysql_query($sql);
echo "<table border=1>\n";
echo "<tr><td>merk</td><td>model</td><td>prijs in €</td><td>kort</td><td>leverbaar</td><td>link</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td> <td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[4], $myrow[3], $myrow[8], $myrow[9]);
}
echo "</query>\n";
?>
<p align="left"> </p>
<p align="left"><br />
</p>
<p align="left"></p>
<p align="left"> </p>
</blockquote>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="85" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1024" height="85" align="center" valign="bottom" background="images/ja.jpg"><div align="center">
<h5>Copyright (c) 2006 <a href="mailto:[email protected]">Mike</a></h5>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
ik ga em even testen
alleen de kolommen staan niet helemaal goed