Tips and FAQs
- How do I see the complete SQL error message?
- I have tried set_col_hidden() method, but the data fields are still showing.
- The PHP datagrid is showing correctly. However, when clicked on the any of the action buttons, I got the following error message: Notice: Undefined index: sql_table in [DIRECTORY NAME]\include\action.php on line [line number]. Could not execute query SELECT * FROM WHERE id=[ID] in db_query()
- How do I hide data fields or set the data fields to be read only?
- I am using Microsoft Access as the database. The datagrid displays fine but whenever I try to update a record I got error message says the records are not accessible.
- I have changed the CSS but I couldn't see the changes when the page is refreshed.
- I am getting weird error, something like "Parse error: parse error, unexpected '<'…".
- Cannot display images and all the CSS styles are quirky.
- Additional phpGrid tips and recommendations
- Set $debug = true in adodb.inc.php in adodb folder to see the complete SQL error message.
- phpGrid fetches database records and stores them in an associate array. Some databases, such as Firebird, Access, the fields name are case-sensitive. Please make sure the name used in the code matches the case when you are using those type of databases. For the best programming practice, it is recommended that the data fields names are matched in case.
- This is because the name of database table has not been set. Please call method set_sql_table() to set the name of the table.
- For fields are not suppose to be displayed, such as primary key, call set_col_hidden() method to hide the fields. In addition, for fields that are suppose to be read only, call set_fields_readonly() method. Please note the data field names are case sensitive in some databases, such Firebird and MS Access.
- When using Access database, make sure that the database file (extension with .mdb) is set to writable.
- Some browsers, such as Internet Explorer, tends to cache the external css content. The changes made to the css may not show up immediately. Please try to clear the browser cache and then restart the browser.
- When you receive "Parse error: parse error, unexpected '<'…" error, make sure you have the lastest Zend Optimizer installed. Download the latest Zend Optimizer here.
- You must call the set_gridpath() to set the file path to the phpGrid class. In addition, You must have to a end the path with a slash. e.g. set_gridpath("mypath/include/");
- a. Golden rule, avoid using magic_quotes_gpc configuration option (php.ini), which automatically adds slashes to any submitted HTML form data or cookies. In other words, it is bad to set magic_quotes_gpc to On.
For example:
magic_quotes_gpc = On // this is bad
b. It is recommended to set set_inlineedit_enabled() to false when debugging your phpGrid because inline edit overrides all the values. For example, using conditional dynamic ouput with set_col_txts will have no effect when inline edit is enabled.
Topics
- Getting Started
- Programming Reference
- Additional Information