[Question] Lỗi Shop PHP |
17/07/2010 02:47:35 (+0700) | #1 | 215527 |
kikilua
Member
|
0 |
|
|
Joined: 28/06/2007 23:30:58
Messages: 13
Offline
|
|
mình đang chạy code shop php
sau khi check thì mình bị mắc lỗi như sau.
An error occurred
Application error
Exception information:
Message: 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 ''' at line 1
Stack trace:
#0 /home/chorachg/public_html/library/Zend/Db/Statement.php(284): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/chorachg/public_html/library/Zend/Db/Adapter/Abstract.php(464): Zend_Db_Statement->execute(Array)
#2 /home/chorachg/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query('SELECT * from c...', Array)
#3 /home/chorachg/public_html/library/Zend/Db/Adapter/Abstract.php(721): Zend_Db_Adapter_Pdo_Abstract->query('SELECT * from c...', Array)
#4 /home/chorachg/public_html/application/models/Category.php(26): Zend_Db_Adapter_Abstract->fetchRow('SELECT * from c...')
#5 /home/chorachg/public_html/application/frontend/sanpham/controllers/DanhmucController.php(16): Category->getCategory('44'')
#6 /home/chorachg/public_html/library/Zend/Controller/Action.php(513): Sanpham_DanhmucController->indexAction()
#7 /home/chorachg/public_html/library/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
#8 /home/chorachg/public_html/library/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /home/chorachg/public_html/library/Zend/Application/Bootstrap/Bootstrap.php(77): Zend_Controller_Front->dispatch()
#10 /home/chorachg/public_html/library/Zend/Application.php(335): Zend_Application_Bootstrap_Bootstrap->run()
#11 /home/chorachg/public_html/index.php(33): Zend_Application->run()
#12 {main}
Request Parameters:
array (
'module' => 'sanpham',
'controller' => 'danhmuc',
'action' => 'index',
'code' => 'ky-thuat-so',
'id' => '44\'',
)
mình muốn hỏi lý do tại sao bị như vậy và cách khắc phục.cảm ơn các bạn nhiều.
(PHP Ver 5) |
|
|
|
|
[Question] Lỗi Shop PHP |
17/07/2010 09:34:41 (+0700) | #2 | 215542 |
|
gamma95
Researcher
|
Joined: 20/05/2003 07:15:41
Messages: 1377
Location: aaa">
Offline
|
|
Code:
array (
'module' => 'sanpham',
'controller' => 'danhmuc',
'action' => 'index',
'code' => 'ky-thuat-so',
'id' => '44\'',
)
Nhìn vào khúc đó
có thấy cái id nó escape 44\' ko ?
|
|
Cánh chym không mỏi
lol |
|
[Question] Lỗi Shop PHP |
17/07/2010 21:08:13 (+0700) | #3 | 215599 |
kikilua
Member
|
0 |
|
|
Joined: 28/06/2007 23:30:58
Messages: 13
Offline
|
|
nếu lỗi ở ID đó làm sao fix được hả anh ... em đã test với các ID khác đều bị tương tự ....
hok lẽ phải xoá nó đi rồi crea lại à...
p/s: em mới bước đầu làm web. |
|
|
|