Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- newUser( 2, 'aksjds', 'pass' );
- function newUser( $email, $parent, $hash )
- {
- $db = db();
- $sql =
- "INSERT INTO users
- ( email, parent, joindate, hash )
- VALUES
- ( ?, ?, now(), ? )
- ";
- if( $query = $db->prepare( $sql ) )
- {
- $bind = $query->bind_param( 'sis', $email, $parent, $hash );
- if( $bind === false )
- {
- die( 'bind_param() failed: ' . htmlspecialchars( $query->error ) );
- }
- $execute = $query->execute();
- if ( $execute === false )
- {
- die( 'execute() failed: ' . htmlspecialchars( $query->error ) );
- }
- $query->close();
- }
- else
- {
- die( 'prepare() failed: ' . htmlspecialchars( $db->error ) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement