Ik ben hier op school bezig met aan access database en het lukt op de 1 of andere manier bij niemand om iets in te voeren. uitlezen lukt wel.
Ik heb al zeker 10 scripts van internet gehaald en 2 zelf geschreven en het lukt niet.
het script dat ik als laatste heb geprobeerd:
invoegen.php:
test.php
Ik heb al zeker 10 scripts van internet gehaald en 2 zelf geschreven en het lukt niet.
het script dat ik als laatste heb geprobeerd:
invoegen.php:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| <?php
$dbLocation = "C:\Inetpub\wwwroot\gastenboek\gastenboek.mdb";
$conn = new COM ("ADODB.Connection")
or die( "Cannot start ADO" );
$conn->Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=".$dbLocation );
$SQL = "INSERT INTO gastenboek ( id , naam , datum , bericht )
VALUES ('$_POST[id]','$_POST[naam]','$_POST[datum]','$_POST[bericht]')";
$conn->Execute( $sSQL ); //Execute SQL query
$conn->Close(); //Close database connection
$conn->Release(); //Release resources for this connection
?> |
test.php
code:
1
2
3
4
5
6
7
8
9
10
| <html> <body> <form action="invoegen.php" method="post"> id: <input type="text" name="id" /> naam: <input type="text" name="naam" /> datum: <input type="text" name="datum" /> bericht: <input type="text" name="bericht" /> <input type="submit" /> </form></body> </html> |
[ Voor 4% gewijzigd door Verwijderd op 30-05-2007 11:18 ]