fuel/docs

tiny mistake

EmRa228 opened this issue · 7 comments

in the this address:

http://fuelphp.com/docs/classes/database/usage.html

// Will execute SELECT * FROM `users` WHERE `name` LIKE "john%"
$who = "john%";
$result = DB::select()->from('users')->where('id', 'like', $who)->execute();

must change to:

$result = DB::select()->from('users')->where('name', 'like', $who)->execute();

also in:
http://fuelphp.com/docs/classes/database/usage.html#/limit_offset

// SELECT * FROM `users` ORDER BY `id` ASC LIMIT 10
DB::select('users')->order_by('id','asc')->limit(10);

must change to:

// SELECT * FROM `users` ORDER BY `id` ASC LIMIT 10
DB::select()->from('users')->order_by('id','asc')->limit(10);

and in:
http://fuelphp.com/docs/classes/database/usage.html#/escaping

// SELECT COUNT(*) FROM `users`
$result = DB::select(DB::expr('COUNT(*) as count'))->from('users')->execute();

must change to:

// SELECT COUNT(*) as count FROM `users`

in
http://fuelphp.com/docs/classes/database/db.html#/method_last_query

example does not work. because it have not ->execute() statement!

change to:

// execute a query
$user = DB::select()->from('users')->where('id', 1)->execute();

Rather than just complaining about the mistakes how about you fork the repo and fix them?

@stevewest I have no information about.Can I?

@stevewest Thank You ;)

No need to ask permission to do so, the whole point of having the code on somewhere like github is so others can contribute.