PHP code example of noodlehaus / mysqli_etc

1. Go to this page and download the library: Download noodlehaus/mysqli_etc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

noodlehaus / mysqli_etc example snippets


$connection = mysqli_connect($host, $username, $password, $database);

# perform an insert
mysqli_insert(
  $connection,
  'INSERT INTO users VALUES (?, ?, ?)',
  $username,
  $email,
  $password
);

# perform an update/delete
mysqli_update(
  $connection,
  'DELETE FROM users WHERE username=?',
  $username
);

# perform a fetch
mysqli_select(
  $connection,
  'SELECT * FROM users WHERE username=? LIMIT 1',
  $username
);

# create an interpolated sql statement
$statement = mysqli_interpolate(
  $connection,
  'SELECT * FROM users WHERE username=?',
  $username
);
mysqli_stmt_execute($statement);