PHP zoekfunctie in sql

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Pagina: « vorige 1 2 3 4 5 volgende »

Robert Deiman

Robert Deiman

23/01/2006 14:19:00
Quote Anchor link
Kan je line 30 t/m line 35 ff posten, is wat makkelijker zoeken dan :)
 
PHP hulp

PHP hulp

16/01/2025 10:59:31
 
Michael

Michael

23/01/2006 14:50:00
Quote Anchor link
van de result pagina of de zoekpagina?
searchpage 30 t/m 35
</blockquote></td>
</tr>
</table></td>
<td width="208" height="107" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>

resultpage 30 tm 35



<!--DWLayoutTable-->
<tr>
<td height="81" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->

ik denk niet dat je hiermee veel verder komt
 
- SanThe -

- SanThe -

23/01/2006 14:57:00
Quote Anchor link
En wat is de exacte foutmelding?
 
Robert Deiman

Robert Deiman

23/01/2006 14:59:00
Quote Anchor link
Parse error: parse error in /data/members/free/tripod/nl/i/n/t/interfoon/htdocs/result.php on line 32

Dat is de foutmelding, maar ik ben dus op zoek naar regel 30 t/m 35 van de gebruikte PHP code. Wat je hier neer zet, lijkt nogal op de html code, maar daar zit de fout niet in, tenminste ik zie hem niet.
Misschien iemand anders?
Gewijzigd op 23/01/2006 15:02:00 door Robert Deiman
 
Michael

Michael

23/01/2006 15:03:00
Quote Anchor link
ik weet dat het lastig is maar ik zet die resultpage er ff helemaal op.
Ja het hele boekwerk:

<!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)
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
<?php







$db
= mysql_connect("localhost", "root");



interfoon_nl_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>&nbsp;</p>
          <
p align="center">Hier vind je de laatste info!<br />
            "info"</p>
          <
/blockquote>


$result = mysql_query("SELECT * FROM products",$db);



echo "<table border=1>\n";



echo "<tr><td>merk</td><td>model</tr>\n";



while ($myrow = mysql_fetch_row($result)) {



        printf("<tr><td>%s %s</td><td>%s</td></tr>\n",
        $myrow[1], $myrow[2], $myrow[3]);







}




echo "</table>\n";







?>
</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>&nbsp;</p>
<blockquote>

<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>
 
Robert Deiman

Robert Deiman

23/01/2006 15:06:00
Quote Anchor link
$db = mysql_connect("localhost", "root");



interfoon_nl_db("mydb",$db);
?> <<-- Je had PHP niet afgesloten

Dat dus aanpassen, en dan moet je

<p align="center">Hier vind je de laatste info!<br />
"info"</p>
</blockquote>

// hier php nog weer openen
$result = mysql_query("SELECT * FROM products",$db);
 
Michael

Michael

23/01/2006 15:29:00
Quote Anchor link
ok ik ben iets verder heb het aangepast maar krijg nu het volgende :

Fatal error: Call to undefined function: interfoon_nl_db() in /data/members/free/tripod/nl/i/n/t/interfoon/htdocs/result.php on line 29
 
Robert Deiman

Robert Deiman

23/01/2006 15:40:00
Quote Anchor link
interfoon_nl_db("mydb",$db); Dat is de fout
________________________________

Probeer het eens zo:
mysql_select_db("mydb",$db);
Gewijzigd op 23/01/2006 15:43:00 door Robert Deiman
 
Michael

Michael

23/01/2006 16:18:00
Quote Anchor link
hij werkt !
echter laat hij de hele tabel zien en filtert niet op criteria
 
Robert Deiman

Robert Deiman

23/01/2006 16:23:00
Quote Anchor link
Klopt, die code die jan je liet zien, eerder in het topic (waar de query wordt gemaakt) moet je gebruiken voor de result.php
Je hebt nu staan (select * from tabel), dus dan selecteerd die ook alles.
 
Michael

Michael

23/01/2006 16:45:00
Quote Anchor link
bedoel je dit gedeelte?

SELECT veld1, veld2
FROM tabel
" . $voorwaarden;
// hierna je query uitvoeren
}
?>
 
Robert Deiman

Robert Deiman

23/01/2006 16:52:00
Quote Anchor link
Jah, dat deel en het deel waar die de voorwaarden maakt. Dat deel met al die if lussen enzo :)
 
Michael

Michael

23/01/2006 16:57:00
Quote Anchor link
ok ja dat staat erin
maar hoe zorg ik ervoor dat ie dan op die criteria selecteerd?
 
Michael

Michael

24/01/2006 18:32:00
Quote Anchor link
$sql = "
SELECT merk, model, kort, prijs, link
FROM products
WHERE" . $voorwaarden;
// hierna je query uitvoeren
echo $sql;
}
?>

zou die het dan zo al niet moeten doen?
want hij werkt niet
 
Michael

Michael

25/01/2006 10:34:00
Quote Anchor link
niemand de oplossing
hij laat dus de hele tabel zien ipv het gewenste resultaat
 
Robert Deiman

Robert Deiman

25/01/2006 10:46:00
Quote Anchor link
Wil je nu dan de hele code nog eens laten zien die je hebt? Dat is iets gemakkelijker kijken wat er niet goed gaat :)
 
Michael

Michael

25/01/2006 12:01:00
Quote Anchor link
<!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"> </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>&nbsp;</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>&nbsp;</p>
<blockquote><br>
<h2>Kies hieronder aan welke eigenschappen het toestel moet voldoen.</h2>
<br>
<br>
<form method="post" action="result.php">
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
<?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 = "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
    echo $sql;
  
    


  }

?>

<table>
<tr>
<td><font face="arial" size=2>Welk merk toestel moet het zijn?</font><br>
<font size=1 face=arial>Kies uit een merk of geen aan "geen voorkeur".</font></td>
<td><select name="merk" style="background-color: #dcdcdc; border: 1px solid #000000;">
<option value="geen voorkeur">geen voorkeur</option>
<option value="Blackberry">Blackberry</option>
<option value="Imate">Imate</option>
<option value="LG">LG</option>
<option value="Motorola">Motorola</option>
<option value="Nokia">Nokia</option>
<option value="Samsung">Samsung</option>
<option value="Sharp">Sharp</option>
<option value="Siemens">Siemens</option>
<option value="Sony-Ericsson">Sony-Ericsson</option>
</select></td>
</tr>
<tr>
<td><font face="arial" size=2>Wilt u een camera op de telefoon?</font><br>
<font size=1 face=arial>Vink aan indien de klant een camera wenst.</font></td>
<td><input name="camera" type="checkbox" value="camera"></td>
</tr>
<tr>
<td><font face="arial" size=2>Wilt u bluetooth op uw toestel?</font><br>
<font size=1 face=arial>Vink aan indien de klant bluetooth wenst.</font> <br>
<font size=1 face=arial><A HREF="bluetooth.html" onClick="popup = window.open('bluetooth.html', 'PopupPage', 'height=450,width=500,scrollbars=yes,resizable=yes'); return false" target="_blank">Wat is bluetooth?</a> </font></td>
<td><input name="bluetooth" type="checkbox" value="bluetooth"></td>
</tr>
<tr>
<td><font face="arial" size=2>Wilt u een UMTS toestel?</font><br>
<font size=1 face=arial>Vink aan indien de klant een UMTS toestel wenst.</font><br>
<font size=1 face=arial> <A HREF="UMTS.html" onClick="popup = window.open('UMTS.html', 'PopupPage', 'height=450,width=500,scrollbars=yes,resizable=yes'); return false" target="_blank">Wat is UMTS?</a> </font></td>
<td><input name="umts" type="checkbox" value="umts"></td>
</tr>
<br>
<tr>
<td><input type="submit" Value="Nu zoeken" style="background-color: #dcdcdc; border: 1 solid #000000">
<input type="reset" Value="Ik doe iets fout" style="background-color: #dcdcdc; border: 1 solid #000000"></td>
</tr>
</table>
</form>
</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>

dit is de hele pagina
maar hij maakt geen subselectie volgens mij en ik kom er zelf niet uit hoe.
 
Robert Deiman

Robert Deiman

25/01/2006 12:05:00
Quote Anchor link
Dit deel:
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
<?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 = "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
    echo $sql;
?>

Moet in result.php in plaats van de query die je daar nu hebt staan.
 
Michael

Michael

25/01/2006 12:09:00
Quote Anchor link
<!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)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php







$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>&nbsp;</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>&nbsp;</p>
<blockquote>

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
<?php

$result
= mysql_query("SELECT * FROM products",$db);



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>


mijn result ziet er nu dus zo uit.
dus wat moet ik precies vervangen en hoe komt mijn zoekpagina er dan uit te zien
??
 
Robert Deiman

Robert Deiman

25/01/2006 12:19:00
Quote Anchor link
Zo komt je result er uit te zien. En voor je zoekpagina, daar mag je die hele php code uit halen.


<!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)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php







$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>&nbsp;</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>&nbsp;</p>
<blockquote>

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
<?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";






?>

<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>
 

Pagina: « vorige 1 2 3 4 5 volgende »



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.