tiny mistake
EmRa228 opened this issue · 7 comments
EmRa228 commented
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();
EmRa228 commented
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);
EmRa228 commented
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`
EmRa228 commented
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();
emlynwest commented
Rather than just complaining about the mistakes how about you fork the repo and fix them?
EmRa228 commented
@stevewest I have no information about.Can I?
EmRa228 commented
@stevewest Thank You ;)
emlynwest commented
No need to ask permission to do so, the whole point of having the code on somewhere like github is so others can contribute.