note 117007 deleted from function.pg-fetch-row by salathe
| From: | salathe@php.net | Date: | Wed, 01 Apr 2015 08:08:34 +0000 |
| Subject: | note 117007 deleted from function.pg-fetch-row by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202118@lists.php.net to get a copy of this message | ||
Note Submitter: test at hotmail dot com
----
<HTML>
<HEAD>
<script language="javascript">
function submittoevoegenform() {
//alert('functie uitgevoerd');
document.forms['frmLeerlingtoevoegen'].submit();
}
</script>
</HEAD>
<BODY>
<?php
include('connect.php');
//INSERT BEGIN
if(isset($_GET['actie']) AND $_GET['actie']=='toevoegen'){
$strVoornaam = $_POST['txtVoornaam'];
$strNaam = $_POST['txtNaam'];
$strPlaats = $_POST['txtPlaats'];
$strSqlinsert = "INSERT INTO
tblleerlingen (leerlingid,
voornaam, naam, straatennr, postnr,
plaats, geboortedatum, klasid) VALUES (NULL,
'$strVoornaam', '$strNaam', '', '', '$strPlaats',
'0000-00-00', '0');";
$mysqli->query($strSqlinsert);
}
//INSERT EINDE
$strSql = "select * from tblleerlingen ORDER BY leerlingid";
$strResult = $mysqli->query($strSql);
$strTabel = "<table border='1'>";
while($strRij = $strResult->fetch_assoc()){
$strVoornaam = $strRij['voornaam'];
$strNaam = $strRij['naam'];
$strPlaats = $strRij['plaats'];
$intLeerlingid = $strRij['leerlingid'];
$strTabel .= "<tr>
<td>$strVoornaam</td>
<td>$strNaam</td>
<td>$strPlaats</td>
</tr>";
}
//form toevoegen leerling (komt onderaan de tabel)
$strVoornaam = "<input type='text' name='txtVoornaam'>";
$strNaam = "<input type='text' name='txtNaam'>";
$strPlaats = "<input type='text' name='txtPlaats'>";
//$strSubmit = "<input type='submit' name='btnSubmit'
value='toevoegen'>";
$strSubmit = "<img width=20 height=20 src='figuren/toevoegen.png'
onclick='submittoevoegenform();'>";
$strTabel .= "<form method='post' name='frmLeerlingtoevoegen'
action='?actie=toevoegen'>
<tr>
<td>$strVoornaam</td>
<td>$strNaam</td>
<td>$strPlaats</td>
<td>$strSubmit</td>
</tr></form>";
$strTabel .= "</table>";
echo $strTabel;
?>
</body>
</html>