ryansuitposungkono / openjs-grid

Automatically exported from code.google.com/p/openjs-grid
0 stars 0 forks source link

Grid breaks when using a reserved word as a table name #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up the grid as usual
2. Point the PHP script to a table named with a reserved word (such as Group, 
like I did)

What is the expected output? What do you see instead?
I would expect it to work as usual, but there is an error "mysql_fetch_assoc() 
expects parameter 1 to be resource, boolean given in openjs/grid.php on line 
454.

What version of the product are you using? On what operating system?
1.8. Mac OS 10.7.3. Chrome browser

Please provide any additional information below.
I fixed the issue by going to line 453 and putting `` around the table name in 
the sql. So the line now reads: $primaryKey = mysql_query("SHOW KEYS FROM 
`$table` WHERE Key_name = 'PRIMARY'"); 

Original issue reported on code.google.com by keyro...@me.com on 18 Feb 2012 at 12:29