- Posts: 7
- Thank you received: 0
Any questions about Documents Sellers, post it here .
mydocs view not working
- Daniele Grassi
- Topic Author
- Offline
- New Member
-
Less
More
15 years 2 weeks ago #2547
by Daniele Grassi
mydocs view not working was created by Daniele Grassi
Hi,
mydocs view is not working, even if the user has some order linked to him. Error given is "No valid database connection 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 ') ORDER BY a.ordering LIMIT 0, 20' at line 1 SQL=SELECT a.* FROM jos15_dms_documents AS a WHERE a.published = 1 AND a.id IN ( ) ORDER BY a.ordering LIMIT 0, 20
No valid database connection 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 SQL=SELECT COUNT(*) FROM jos15_dms_documents AS a WHERE a.published = 1 AND a.id IN ( )"
mydocs view is not working, even if the user has some order linked to him. Error given is "No valid database connection 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 ') ORDER BY a.ordering LIMIT 0, 20' at line 1 SQL=SELECT a.* FROM jos15_dms_documents AS a WHERE a.published = 1 AND a.id IN ( ) ORDER BY a.ordering LIMIT 0, 20
No valid database connection 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 SQL=SELECT COUNT(*) FROM jos15_dms_documents AS a WHERE a.published = 1 AND a.id IN ( )"
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
15 years 2 weeks ago #2548
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:mydocs view not working
Hi
Could you submit a support ticket contains your site information so that I can check it for you ? No one reported this issue before .
Thanks,
Tuan
Could you submit a support ticket contains your site information so that I can check it for you ? No one reported this issue before .
Thanks,
Tuan
Please Log in or Create an account to join the conversation.
- Daniele Grassi
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 7
- Thank you received: 0
15 years 2 weeks ago #2549
by Daniele Grassi
Replied by Daniele Grassi on topic Re:mydocs view not working
I checked again, and the problem happens when the user doesn't have a purchased item. I solved it changing the buildContentsWhere function in mydocs model to
$docs = DMSHelper::getDownloadableDocs(false) ;
$docs = array_merge($docs, $docs) ;
$where = array() ;
$where[] = ' a.published = 1 ';
$whereIN = implode(',', $docs);
if ($whereIN === '') {
$where[] = ' false';
} else {
$where[] = ' a.id IN ( '. $whereIN . ')' ;
}
$where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );
return $where;
$docs = DMSHelper::getDownloadableDocs(false) ;
$docs = array_merge($docs, $docs) ;
$where = array() ;
$where[] = ' a.published = 1 ';
$whereIN = implode(',', $docs);
if ($whereIN === '') {
$where[] = ' false';
} else {
$where[] = ' a.id IN ( '. $whereIN . ')' ;
}
$where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' );
return $where;
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
15 years 2 weeks ago #2550
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:mydocs view not working
Oh
Thanks so much for sharing the code . I will update this fix and update the latest code to server .
Thanks,
Tuan
Thanks so much for sharing the code . I will update this fix and update the latest code to server .
Thanks,
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.