Welcome to Geeklog, Anonymous Sunday, September 01 2024 @ 01:44 am EDT
Geeklog Forums
PHP 5 with fresh Geeklog 14 install - SQL Error
ronack
An SQL error has occurred. Please see error.log for details.
Checking the GL 1.4 error log I find.
2/23/05 15:45:24 - 1366: Incorrect integer value: '' for column 'statuscode' at row 1. SQL in question: REPLACE INTO gl_stories (sid,uid,tid,title,introtext,bodytext,hits,date,comments,related,featured,commentcode,trackbackcode,statuscode,expire,postmode,frontpage,draft_flag,numemails,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,show_topic_icon,in_transit) VALUES ('20051223154507351',2,'GeekLog','test','test','',0,FROM_UNIXTIME(1135370707),'0','',0,'0','-1','',FROM_UNIXTIME(943981207),'plaintext','1',0,0,2,3,3,2,2,2,1,1)
This is the site here
Am I missing a setting in PHP for this to work properly or what?
ronack
For admin/plugins/staticpage.php I added this on line 475
I'm sure it's not right but at least it's working. Please let me know if you have some other solution.
Dirk
In the database, we store the status of a checkbox (e.g. sp_inblock, i.e. wrap static page in a block) as TINYINTs with a value of 0 (unchecked) or 1 (checked). The POST request for the HTML form, however, returns the string "on" for a checked checkbox.
So Geeklog has to check if sp_inblock equals "on" and if it does, store that as "1" in the database. Looks like not all checkboxes in the static pages editor have been handled properly, though. I have now fixed that and would like to ask you to please try it again with the current CVS version, as I still can't reproduce the SQL error.
In the Admin's story editor, some of the integer values (from dropdowns such as "statuscode") were treated as strings which could have caused them ending up being stored as empty strings instead of zeros. Again, this should be fixed in CVS now. Please try that out, too.
bye, Dirk
congleal
12/31/2006 04:33:03 PM - 1366: Incorrect integer value: '' for column 'statuscode' at row 1. SQL in question: REPLACE INTO gl_stories (sid,uid,tid,title,introtext,bodytext,hits,date,comments,related,featured,commentcode,statuscode,expire,postmode,frontpage,draft_flag,numemails,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,show_topic_icon) VALUES ('20060425181314943',4,
Any help would be greatly appreciated! Happy New Year!
Rgds,
Lee
ronack
I think part of the confusion here comes from how checkboxes are handled:<br /><br />In the database, we store the status of a checkbox (e.g. sp_inblock, i.e. wrap static page in a block) as TINYINTs with a value of 0 (unchecked) or 1 (checked). The POST request for the HTML form, however, returns the string "on" for a checked checkbox.<br /><br />So Geeklog has to check if sp_inblock equals "on" and if it does, store that as "1" in the database. Looks like not all checkboxes in the static pages editor have been handled properly, though. I have now fixed that and would like to ask you to please try it again with the current CVS version, as I still can't reproduce the SQL error.<br /><br />In the Admin's story editor, some of the integer values (from dropdowns such as "statuscode" were treated as strings which could have caused them ending up being stored as empty strings instead of zeros. Again, this should be fixed in CVS now. Please try that out, too.<br /><br />bye, Dirk
Dirk
Which Geeklog, PHP and MySQL versions are we talking about? Geeklog 1.4.0 and later should work just fine "out of the box" with the most recent versions of both PHP and MySQL. The only exception is the list of members of a group in 1.4.0, that throws an SQL error on MySQL 5 (fixed in Geeklog 1.4.1).
bye, Dirk
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content