PHP code example of chamamme / noquery

1. Go to this page and download the library: Download chamamme/noquery 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/ */

    

chamamme / noquery example snippets


	
	 $config = [
	        'driver' 	=> 'mysqli', #eg. access,ado,ibase,fbsql,db2,informix,ldap,mssqlnative,netezza,odbc,odbtp,oci8,pdo,postgres9,proxy,ads,sybase_ase,sqlite3,sybase

		'server' 	=> "localhost",

		'username' 	=> "root",

		'password' 	=> "",

		'port' 		=> "3306",

		'database' 	=> "test_db",

		'debug' 	=> false

	];
  
$db = new  NoQuery\Builder( $config ) 
 
 
 use NoQuery\Builder;
 
$config = [
	    'driver' 	=> "mysqli",
		'server' 	=> "localhost",
		'username' 	=> "root",
		'password' 	=> "",
		'port' 		=> "3306",
		'database' 	=> "test_db",
		'debug' 	=> false
	];
	
	$db = new Builder( $config ) ; #Instantiate the Builder class
	
	#select query
	$db->table('users')
		->select(['name','gender','age'])
		->get();
		
	#update statement
	$db->table('users')
		  ->update(['name'=>'Chamamme'])
		  ->where(["id = 5","gender ='male'"])
		  ->go();