Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Some mySQL syntax that can lead to broken code

 
Reply to topic    Forum Index » Bugs and errors View previous topic
View next topic
Some mySQL syntax that can lead to broken code
Author Message
BadDog



Joined: 21 Nov 2005
Posts: 62

Post Some mySQL syntax that can lead to broken code Reply with quote
I have a few suggestions for correcting some bugs here, mainly have to do with mySQL syntax that breaks under current mySQL versions. Example, comments were not being added because of this code:



Code:


$sql->insert(array(

'table'    => 'comments',

'values' => array(

         'post_id' => $id,

         'date'     => $time,

         'author'  => $name,

         'mail'     => $mail,

         'ip'     => $_SERVER['REMOTE_ADDR'],

         'comment' => $comments

         )

));







The fix was to use this code instead:



Code:




'table'  => 'comments',

'values' => array(

             'date'    => $time,

             'author'  => $name,

             'mail'    => $mail,

             'ip'      => $_SERVER['REMOTE_ADDR'],

             'comment' => $comments,

             'reply' => $reply,

             'post_id' => $id)

));





The same thing with adding news, the actual table fields are not in the same order as the insert script that adds the news, newer mySQL defaults do not like this!



half of my news imports was rejected because url and title in news table was string type and not text type. Very bad, use TEXT TYPE for url and title in news table to avoid all possible errors!!!!!!



Another strange thing I noticed was the index ID for news table starts with 1 and story table starts with index 0 during convert. Not good!
Tue Jan 03, 2006 11:14 pm View user's profile Send private message
Guest








Please login to hide the ads.

Display posts from previous:    
Reply to topic    Forum Index » Bugs and errors All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.