Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MethodDescriptionUsageReturns

select(string $select)

 


$select

SQL Select

Select statement for sql query

Code Block
languagephp
// Method chaining
->select('user_id, user_name')
 
// SQL equivalent
SELECT user_id, user_name

object Core\Db

from(string $table [, string $alias] )

 


$table

Database table name.


$alias

(optional) Table alias.

 Define the table in your SELECT query.

Info

Table Prefix: Be sure to prefix tables with a colon.

Code Block
languagephp
 // Method chaining
->from(':user', 'u')

// SQL equivalent
FROM prefix_user AS u
object Core\Db

where(array $condition)

 


$condition

SQL condition in an ARRAY format.

SQL conditions in our database layer when it comes
to WHERE support an associative array of values. 

Associative array of a conditional statement.

Learn more here.

Code Block
// Method chaining
->where([
	'user_name' => 'Foo',
	'full_name' => 'Bar'
])
 
// SQL equivalent
WHERE user_name = "Foo" AND full_name = "Bar"
 
object Core\Db

...