Title: SQLSTATE[42000] OR SQLSTATE[42S22] · Issue #7 · emran/ssp · GitHub
Open Graph Title: SQLSTATE[42000] OR SQLSTATE[42S22] · Issue #7 · emran/ssp
X Title: SQLSTATE[42000] OR SQLSTATE[42S22] · Issue #7 · emran/ssp
Description: When i set // Table's primary key $primaryKey = '`company`.`id`'; in ssp.class on this part // Total data set length $count_request = "SELECT COUNT(`{$primaryKey}`)"; if ($joinQuery) { $count_request .= $joinQuery; } else { $count_reques...
Open Graph Description: When i set // Table's primary key $primaryKey = '`company`.`id`'; in ssp.class on this part // Total data set length $count_request = "SELECT COUNT(`{$primaryKey}`)"; if ($joinQuery) { $count_reque...
X Description: When i set // Table's primary key $primaryKey = '`company`.`id`'; in ssp.class on this part // Total data set length $count_request = "SELECT COUNT(`{$primaryKey}`)"; if ($joi...
Opengraph URL: https://github.com/emran/ssp/issues/7
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SQLSTATE[42000] OR SQLSTATE[42S22]","articleBody":"When i set \n\n```\n// Table's primary key\n$primaryKey = '`company`.`id`';\n```\n\nin ssp.class on this part\n\n```\n// Total data set length\n$count_request = \"SELECT COUNT(`{$primaryKey}`)\";\nif ($joinQuery) {\n $count_request .= $joinQuery;\n} else {\n $count_request .= \"FROM `$table`\";\n}\n```\n\nI get this sql:\n\n```\nSELECT COUNT(``company`.`id``) FROM `company` LEFT JOIN `city` ON `company`.`city` = `city`.`id`\n```\n\nAnd error\n\n```\n{\"error\":\"An SQL error occurred: SQLSTATE[42000]: Syntax error or access violation: 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 'company`.`id``) FROM `company` LEFT JOIN `city` ON `company`.`city` = `city`.`id' at line 1\"}\n```\n\nAnd when i set\n\n```\n$primaryKey = 'company.id';\n```\n\nI get this sql:\n\n```\nSELECT COUNT(`company.id`) FROM `company` LEFT JOIN `city` ON `company`.`city` = `city`.`id`\n```\n\nAnd error\n\n```\n{\"error\":\"An SQL error occurred: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'company.id' in 'field list'\"}\n```\n\nI think that need set \n\n```\n$count_request = \"SELECT COUNT({$primaryKey})\";\n```\n\nwithout \n\n```\n`\n```\n\nAnd use\n\n```\n$primaryKey = '`company`.`id`';\n```\n","author":{"url":"https://github.com/tagplus5","@type":"Person","name":"tagplus5"},"datePublished":"2015-12-19T22:57:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/7/ssp/issues/7"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:78a01cc7-f23a-0216-40bd-319009267bb0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E89E:2ED9BA:565A1D:7A6EA3:6A4BCD3E |
| html-safe-nonce | aa4ea89ef43ad7d2da31ef9d207dc7891dfaece3a2c7d0e7ef8bd7debf1679c6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODlFOjJFRDlCQTo1NjVBMUQ6N0E2RUEzOjZBNEJDRDNFIiwidmlzaXRvcl9pZCI6IjIzMTA3MzE5MzY3ODA2NDk1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3fcfb441e0962271b6a3b8dddb8abd745555400530582d52dc6e7f70e7729a36 |
| hovercard-subject-tag | issue:123115350 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/emran/ssp/7/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7012ee652317aa0be10d26282020b38a5a8fbbd70022c45dfe2c47e42e31ad6/emran/ssp/issues/7 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7012ee652317aa0be10d26282020b38a5a8fbbd70022c45dfe2c47e42e31ad6/emran/ssp/issues/7 |
| og:image:alt | When i set // Table's primary key $primaryKey = '`company`.`id`'; in ssp.class on this part // Total data set length $count_request = "SELECT COUNT(`{$primaryKey}`)"; if ($joinQuery) { $count_reque... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tagplus5 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 14aa00ce5bdb34d0eefb5facbffd7de9e144c688d8a93ef8df902d5f94b51dd7 |
| turbo-cache-control | no-preview |
| go-import | github.com/emran/ssp git https://github.com/emran/ssp.git |
| octolytics-dimension-user_id | 2232652 |
| octolytics-dimension-user_login | emran |
| octolytics-dimension-repository_id | 20195286 |
| octolytics-dimension-repository_nwo | emran/ssp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20195286 |
| octolytics-dimension-repository_network_root_nwo | emran/ssp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 58b8f89190447502561829f30862aa0a99d53367 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width