Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

sql where group = 10 is error #13

Closed
wuchuguang opened this issue Oct 18, 2017 · 5 comments
Closed

sql where group = 10 is error #13

wuchuguang opened this issue Oct 18, 2017 · 5 comments

Comments

@wuchuguang
Copy link

where group = 10 is ok

@wuchuguang
Copy link
Author

$this->where('group', 10);

@jstayton
Copy link
Owner

Hi wachuguang,

I'm not sure I understand. Can you post some more code and the resulting SQL that's failing? Thanks.

@wuchuguang
Copy link
Author

$miner = new Miner(...);
$miner->from('my_table');
$miner->where('group', 10);
$miner->select('*');
$sql = $miner->getStatement();
use $sql to execute in sql client , is report error.

@arabcoders
Copy link

i think what he means is that if you use reserved keyword such as "group, from, to" they get interpreted as sql keyword not a field name, i had the same problem with my own sql builder, the best option is to escape the fieldnames so instead of the query being select * from my_table where group = 10 it becomes

SELECT * FROM `my_table` WHERE `group` = 10

@jstayton
Copy link
Owner

jstayton commented Jan 3, 2020

@wuchuguang I'm very sorry for never responding to you here. As my silence likely hinted, I stopped maintaining this project long ago. I'm now officially deprecating it to make that clear.

If you'd like to continue supporting a forked version, please reach out on Twitter (@kidjustino) to have it listed in the README.

@jstayton jstayton closed this as completed Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants