News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Converting polls from IPB 2.3.6 to SMF 1.1.13

Started by raylu, February 22, 2011, 07:20:20 PM

Previous topic - Next topic

raylu

I had an error converting poll options. The error was a MySQL error about the number of columns not being equal to the number of values passed in one of the rows. I inspected the row and it was indeed the case. I don't know what caused it, but I stepped around it by requiring $choice have 2 elements in invision2_to_smf.sql

/******************************************************************************/
--- Converting poll options...
/******************************************************************************/

---* {$to_prefix}poll_choices
---{
$no_add = true;
$keys = array('ID_POLL', 'ID_CHOICE', 'label', 'votes');

$choices = @unserialize(stripslashes($row['choices']));

if (is_array($choices))
        foreach ($choices as $choice)
        {
                if (count($choice) == 2) {
                        $choice = addslashes_recursive($choice);
                        $rows[] = "$row[ID_POLL], SUBSTRING('" . implode("', 1, 255), SUBSTRING('", $choice) . "', 1, 255)";
                }
        }
---}
SELECT pid AS ID_POLL, choices
FROM {$from_prefix}polls;
---*


EDIT: Actually, I think I was using the 2.0.x converter (which is labeled the Invision 2 converter; perhaps this should be changed). I grabbed the 2.3.x converter off the forums and it worked without modification.

Advertisement: