Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Database enz.
- $db = array (
- 'host' => 'localhost',
- 'dbname' => 'steenpapierschaar',
- 'user' => 'root',
- 'pass' => ''
- );
- try
- {
- $db = new PDO('mysql:host='.$db['host'].';dbname='.$db['dbname'], $db['user'], $db['pass']);
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $db->query("SET SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY'");
- }
- catch(PDOException $e)
- {
- $sMsg = '<p>
- Regelnummer: '.$e->getLine().'<br />
- Bestand: '.$e->getFile().'<br />
- Foutmelding: '.$e->getMessage().'
- </p>';
- trigger_error($sMsg);
- }
- try
- {
- $sQuery = "
- INSERT INTO uitslag
- (
- user_id,
- resultaat
- )
- VALUES
- (
- '22',
- '".$uitslag."'
- )
- ";
- $oStmt = $db->prepare($sQuery);
- $oStmt->execute();
- $id = $db->lastInsertId();
- }
- catch(PDOException $e)
- {
- $sMsg = '<p>
- Regelnummer: '.$e->getLine().'<br />
- Bestand: '.$e->getFile().'<br />
- Foutmelding: '.$e->getMessage().'
- </p>';
- trigger_error($sMsg);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement