Div Errors? Quotes Errors? Not sure.

A place for users and developers of the Xataface to discuss and receive support.

Postby Aoirthoir » Mon May 29, 2006 9:08 am

Ok I have several tables that have as the first field a field named "Div". When I try to access any of those fields I get the following error:

Fatal error: Error retrieving title from database in Dataface_QueryTool::getTitles(): SELECT RecordID,DIV as __titleColumn__ FROM PUDTL LIMIT 250You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DIV as __titleColumn__ FROM PUDTL LIMIT 250' at line 1
On line 111 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\QueryTool.php in function printStackTrace()
On line 205 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\ResultController.php in function getTitles(,1,1)
On line 294 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\ResultController.php in function getContentsList()
On line 458 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\TableView.php in function toHtml()
On line 1149 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\TableView.php in function _controller()
On line 452 of file E:\xamp\xampp\htdocs\xampp\dataface\Dataface\Application.php in function toHtml()
On line 26 of file E:\xamp\ in E:\xamp\xampp\htdocs\xampp\dataface\Dataface\QueryTool.php on line 111

Now if I move div to the FOURTH position then the error ceases. If it is in the first, second or third position it continues. Or if I rename the field the error ceases.

I've not had an opportunity to look over your code yet so I am only guessing at the following (plus I am only learning PHP now..so even then it would be perhaps a guess.) But when I run an SQL query on phpMyAdmin, I notice that each field name is surrounded by single quotes. But in the error msg again for the SQL statement, there is no quotes around the field names. So I am guessing that perhaps div is an SQL statement of some sort?

Now I can and will just rename the fields to Division instead of DIV for now. But it is something I thought we should be aware of.

Holler.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon May 29, 2006 11:14 am

Hi,

You're right that this is a Quotes issue, because DIV is a reserved word. I filed a bug in the bug tracker at http://sourceforge.net/tracker/index.php?func=detail&aid=1497095&group_id=153729&atid=788932 and have attached a patch to fix this issue there.

Let me know how it goes.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Mon May 29, 2006 12:14 pm

Thanks bro. I will download the link tomorrow most likely and give it a try.

Again thank you for your prompt responses.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Mon May 29, 2006 12:17 pm

Ok I went to the bug tracker just to read before me and my gal leave for lunch. And when I saw how easy the patch was to run, I downloaded it. It worked great! No more issues with my div field. Thanks bro.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved