Posted on: 12/23/05 03:54pm
By: ronack
This comes from another thread but I'm sure that PHP 5 must either be missing a setting or has something set that PHP 4.x.x didn't have. I just installed a fresh install of GL 1.4 tried to submit a storie and received
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[*1]
Am I missing a setting in PHP for this to work properly or what?
PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 12/23/05 04:42pm
By: ronack
More information, the problem is only admin. Anonymous and Regular users seem to be working ok.
PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 12/23/05 04:54pm
By: ronack
Dirk, could this be a problem. In admin/story.php it says this
* @param string $statuscode Status of the story
Yet in MySQL statuscode is shown as TinyINT
PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 12/23/05 06:10pm
By: ronack
Dirk, I don't know if this is a good fix or not but at least I can post admin/submit.php and admin/plugins/staticpages.php. for admin/submit.php I change the statuscode field in mysql to Varchar and gave it a value of 20.
For admin/plugins/staticpage.php I added this on line 475
$sp_nf = 0;
I'm sure it's not right but at least it's working. Please let me know if you have some other solution.
PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 01/06/06 05:33am
By: Dirk
I think part of the confusion here comes from how checkboxes are handled:
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
Re: PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 12/31/06 05:12pm
By: congleal
I having a similar problem and updating my "MySQL", I kind of understand but not completely sure how to correct my error.
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
Re: PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 01/01/07 09:40am
By: ronack
Quote by: DirkI 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
Wish I could Dirk but I no longer have the server with PHP 5 my other server has PHP 4.4.4 and everything seems to work okay.
Re: PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 01/01/07 10:32am
By: congleal
Sorry for my ignorance... but what am I to do to correct this error?
Rgds,
Lee
Re: PHP 5 with fresh Geeklog 14 install - SQL Error
Posted on: 01/01/07 10:37am
By: Dirk
First of all, let me point out that this thread is already a year old ...
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