PHP Fatal error: Uncaught exception 'PDOException' with mes

All ApPHP DataGrid script bugs discussion. Questions and requests here.
Please, use a $debug_mode = true; before you say "Why Nothing Works ?!" (solves 90% of all issues)

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

daav
Junior
Junior
Posts: 16
Joined: May 8th, '09, 23:17
Location: san francisco, ca usa

PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby daav » Oct 30th, '12, 17:33

Hello,

I'm getting these errors in my logs sometimes (for the first error the table does exist):

Code: Select all

PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.table' doesn't exist' in /filepath/datagrid.class.php:9685\nStack trace:\n#0 /filepath/datagrid.class.php(9685): PDOStatement->fetch()\n#1 /filepath/datagrid.class.php(3788): DataGrid->dgFetchRow(Object(PDOStatement))\n#2 /filepath/datagrid.class.php(1538): DataGrid->DrawTabular()\n#3 /filepath/datagrid.class.php(1858): DataGrid->Show()\n#4 /filepath/index.php(410): DataGrid->Bind()\n#5 {main}\n  thrown in /filepath/datagrid.class.php on line 9685


also:

Code: Select all

PHP Fatal error:  Call to a member function rowCount() on a non-object in /filepath/datagrid.class.php on line 5176,


What is the meaning of these errors? I'm using datagrid 7.5.9

administrator
Site Admin
Site Admin
Posts: 5990
Joined: Jan 7th, '09, 23:18
Contact:

Re: PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby administrator » Oct 31st, '12, 07:37

1. Update your datagrid to the latest v7.7.7
2. If this operation doesn't help - what SELECT SQL you define for View Mode?

stillbatt
Newbie
Newbie
Posts: 1
Joined: Jun 19th, '13, 10:07

Re: PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby stillbatt » Jun 19th, '13, 10:29

We need these parameters for the case when you sorted or filtered your datagrid before in View mode to save them and back to the previous page.





http://www.units.it/
http://www.eccouncil.org/
http://www.free-braindumps.net/
http://www.ucla.edu/
http://en.wikipedia.org/wiki/EC-Council
https://www.facebook.com/ECCouncil
http://www.youtube.com/user/Apple
Last edited by stillbatt on Aug 26th, '14, 06:02, edited 2 times in total.

ceremonychap
Junior
Junior
Posts: 13
Joined: Jul 5th, '11, 15:58

Re: PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby ceremonychap » Sep 10th, '13, 17:11

I have similar error. I am on
"DataGrid v7.7.7 | Extension: PDO | Database: mysql | Total running time: 0.183544 sec."
MySQL 5.5
Window 7, 32 bit
Apache 2.2

I am recreating code_2_6_example.php, with a Master/Detail datagrid. I am able to Add/Edit/Detail on the second (Detail) grid without any glitch. But when I enable "Add/Edit/Detail" on the master grid I get error on all the three options.

Here are what have happened:
I turn on the debug_mode. For master datagrid, it displays correctly the two records in my database.

-------------------------
Retrieve data for current mode #2:
select sql (total: 2 | time: 0.0008 sec.) SELECT tblcourse._idCourse, IF(tblcourse._idCourse = 0, CONCAT('', tblcourse._CourseName, ''), tblcourse._CourseName) AS SortName, 'Phone Detail'AS link_to_phon FROM tblcourse INNER JOIN tblconstit ON tblcourse._idConstit = tblconstit._idConstit WHERE 1=1 ORDER BY _idCourse ASC LIMIT 0, 10

Retrieve data for current mode #2:
select sql (total: 2 | time: 0.0007 sec.) SELECT tblcourse._idCourse, IF(tblcourse._idCourse = 0, CONCAT('', tblcourse._CourseName, ''), tblcourse._CourseName) AS SortName, 'Phone Detail'AS link_to_phon FROM tblcourse INNER JOIN tblconstit ON tblcourse._idConstit = tblconstit._idConstit WHERE 1=1 ORDER BY _idCourse ASC LIMIT 0, 10

POST:
Array
(
)


GET:
Array
(
)


FILES:
Array
(
)


Warnings:

1) Prefix that starts from "reg" may lead to unstable work of datagrid! Please define another prefix.


DataGrid v7.7.7 | Extension: PDO | Database: mysql | Total running time: 0.240299 sec.
-------------------------

1. When I press "Details", it does not give provide me the Apphp's friendly debug message. It spills out the exception below.
---------------------------
Fatal error: Uncaught exception 'PDOException' with 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 'WHERE IN ('-1' , '1' ) LIMIT 0, 10' at line 1' in C:\2013\NEWGOLF\datagrid.class.php:5229 Stack trace: #0 C:\2013\NEWGOLF\datagrid.class.php(5229): PDO->query('SELECT * FROM ...') #1 C:\2013\NEWGOLF\datagrid.class.php(2271): DataGrid->SetTotalNumberRows('', 'LIMIT 0, 10 ', '', false) #2 C:\2013\NEWGOLF\datagrid.class.php(1799): DataGrid->GetDataSet('', 'LIMIT 0, 10 ', '') #3 C:\2013\NEWGOLF\H2datagrid.php(360): DataGrid->Bind() #4 {main} thrown in C:\2013\NEWGOLF\datagrid.class.php on line 5229
-------------------------

2. When I press "+ Add New"
-------------------------
It does not display the my $em_columns array for me to input, but it gives me the following error.


* Items marked with an asterisk are required
Cancel

Retrieve data for current mode #2:
select sql (total: 2 | time: 0.0008 sec.) SELECT tblcourse._idCourse, IF(tblcourse._idCourse = 0, CONCAT('', tblcourse._CourseName, ''), tblcourse._CourseName) AS SortName, 'Phone Detail'AS link_to_phon FROM tblcourse INNER JOIN tblconstit ON tblcourse._idConstit = tblconstit._idConstit WHERE 1=1 ORDER BY _idCourse ASC LIMIT 0, 10

Retrieve data for current mode #2:
select sql (total: 0 | time: 0.0003 sec.) SELECT .* FROM ORDER BY _idCourse ASC LIMIT 0, 10

POST:
Array
(
[regn_mode] => add
[regn_rid] => -1
[regn_sort_field] => _idCourse
[regn_sort_type] => ASC
[regn_page_size] => 10
[regn_p] => 1
)


GET:
Array
(
)


FILES:
Array
(
)


Errors:

1) Line: 5262 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 '* FROM' at line 1

2) Line: 9784 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 '* FROM ORDER BY _idCourse ASC LIMIT 0, 10' at line 1


Warnings:

1) Prefix that starts from "reg" may lead to unstable work of datagrid! Please define another prefix.


DataGrid v7.7.7 | Extension: PDO | Database: mysql | Total running time: 0.138995 sec.
-------------------------

3. When I press "Edit"
It does not display the my $em_columns array for me to edit, but it gives me the following error.
-------------------------
* Items marked with an asterisk are required Printable View

Retrieve data for current mode #2:
select sql (total: 2 | time: 0.0007 sec.) SELECT tblcourse._idCourse, IF(tblcourse._idCourse = 0, CONCAT('', tblcourse._CourseName, ''), tblcourse._CourseName) AS SortName, 'Phone Detail'AS link_to_phon FROM tblcourse INNER JOIN tblconstit ON tblcourse._idConstit = tblconstit._idConstit WHERE 1=1 ORDER BY _idCourse ASC LIMIT 0, 10

POST:
Array
(
[regn_mode] => edit
[regn_rid] => -1
[regn_sort_field] => _idCourse
[regn_sort_type] => ASC
[regn_page_size] => 10
[regn_p] => 1
)


GET:
Array
(
)


FILES:
Array
(
)

Warnings:

1) Field [_idCourse] used for sorting in View Mode was not found in the list of Edit Mode fields. Using such field may cause for unexpected behavior of DataGrid. Please fix this or use another field for sorting.


DataGrid v7.7.7 | Extension: PDO | Database: mysql | Total running time: 0.124805 sec.
-------------------------

Your help is greatly appreciated

ceremonychap
Junior
Junior
Posts: 13
Joined: Jul 5th, '11, 15:58

Re: PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby ceremonychap » Sep 11th, '13, 04:25

Solved***
I overlooked and forgot completely to add the block, as defined in code template
## +---------------------------------------------------------------------------+
## | 7. Add/Edit/Details Mode Settings: |
## +---------------------------------------------------------------------------+
which define "add/edit" mode table properties.

Thank,

administrator
Site Admin
Site Admin
Posts: 5990
Joined: Jan 7th, '09, 23:18
Contact:

Re: PHP Fatal error: Uncaught exception 'PDOException' with mes

Postby administrator » Sep 11th, '13, 07:15

Please send us a link to your page online, so we could test it.
Also, please define any unique prefix for datagrid, for ex.: abc_


Return to “ApPHP DataGrid {bugs}”