Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need some help #309

Closed
xensor opened this issue Nov 5, 2015 · 3 comments
Closed

Need some help #309

xensor opened this issue Nov 5, 2015 · 3 comments

Comments

@xensor
Copy link

xensor commented Nov 5, 2015

[code]
$this->db->select("news", ["[>]news_cats" => ["cat_id" => "id"]], [
"news.*",
"news_cats.name"
], [

        "ORDER" => "news.id DESC",
        "LIMIT" => [$start,$limit]
    ]);

[/code]

see this is my issue.

its not showing properly.

so can someone help me out with this code. please

it would be thankful. I am going insane with how its not giving results.

this is what i am getting when i try it:

[code]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '."author","news"."title","news"."postdate","news"."cat_id","news"."id","news_cat' at line 1

[/code]

@xensor
Copy link
Author

xensor commented Nov 5, 2015

I got it to work. but can someone still explain to me how it works better. the docs isn't really friendly.

@SyuTingSong
Copy link
Contributor

The filed author was not used in your PHP code. Maybe the error caused by other query.

Please add debug method $this->db->debug()->select(... to print the SQL code generated by Medoo to debug.

BTW, you can use Markdown 4-space-indent to present code block.

@catfan
Copy link
Owner

catfan commented Nov 22, 2015

Do not use news.* for table joining.

@catfan catfan closed this as completed Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants