Meerdere rijen onder elkaar
Eerst de leverancierscode en dan merk, type en uitvoering.
Hij geeft nu echter maar 1 rij weer.
Wat is de code om meerdere rijen weer te geven?
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
/****************************************************
*Initialisatie
****************************************************/
$_srv = $_SERVER['PHP_SELF'];
try{
function __autoload($className) {
require_once "../klassen/$className.class.php";}
include("../connections/pdo.inc.php");
include("../php_lib/createSelect.inc.php");
include("../php_lib/menu.inc.php");
include("../php_lib/drop_down.inc.php");
/*******************************************
*
* formulier behandeling
*
********************************************/
if (! isset($_POST["submit"]) && ! isset($_POST["aanpassen"])) // geen formulier
{
throw new myExeption("illegal access");
}
if (isset($_POST["aanpassen"]))
{
$_levid = $_POST['levid'];
$_result = $_PDO -> query("Select * FROM v_alles WHERE levid = '$_levid'");
if ($_result -> rowCount() <= 0)
{
throw new myExeption("database inconsistency");
}
while ($_row = $_result -> fetch(PDO::FETCH_ASSOC))
{
$_output= "<h1>Auto's bij leverancier: ".$_row['bedrijf']."</h1>
<form method='POST' action='$_srv'>
".$_row['levcodeauto']."<br>
".$_row['merk']." ".$_row['type']." ".$_row['uitvoering']."
<input type ='hidden' name ='levid' value ='".$_row['levid']."'>
";
$_output.="
</form>";
}
}
/*********************************************
*
* output
*
**********************************************/
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('FO'));
$_smarty->assign('menuv',menu(3));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('fo_autolev.tpl');
}
catch (myExeption $e)
{
$e->log("../logs/error_log.csv");
echo $e->userMessage();
}
?>
/****************************************************
*Initialisatie
****************************************************/
$_srv = $_SERVER['PHP_SELF'];
try{
function __autoload($className) {
require_once "../klassen/$className.class.php";}
include("../connections/pdo.inc.php");
include("../php_lib/createSelect.inc.php");
include("../php_lib/menu.inc.php");
include("../php_lib/drop_down.inc.php");
/*******************************************
*
* formulier behandeling
*
********************************************/
if (! isset($_POST["submit"]) && ! isset($_POST["aanpassen"])) // geen formulier
{
throw new myExeption("illegal access");
}
if (isset($_POST["aanpassen"]))
{
$_levid = $_POST['levid'];
$_result = $_PDO -> query("Select * FROM v_alles WHERE levid = '$_levid'");
if ($_result -> rowCount() <= 0)
{
throw new myExeption("database inconsistency");
}
while ($_row = $_result -> fetch(PDO::FETCH_ASSOC))
{
$_output= "<h1>Auto's bij leverancier: ".$_row['bedrijf']."</h1>
<form method='POST' action='$_srv'>
".$_row['levcodeauto']."<br>
".$_row['merk']." ".$_row['type']." ".$_row['uitvoering']."
<input type ='hidden' name ='levid' value ='".$_row['levid']."'>
";
$_output.="
</form>";
}
}
/*********************************************
*
* output
*
**********************************************/
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('FO'));
$_smarty->assign('menuv',menu(3));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('fo_autolev.tpl');
}
catch (myExeption $e)
{
$e->log("../logs/error_log.csv");
echo $e->userMessage();
}
?>
Er zijn nog geen reacties op dit bericht.