News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

IPB 1.3 -> SMF RC3 -- ERROR at Poll Choices

Started by ExcalibursZone, September 27, 2006, 09:20:00 PM

Previous topic - Next topic

ExcalibursZone

Here's the SQL error:
Converting poll options... Unsuccessful!
This query:

    INSERT INTO `smf`.smf_poll_choices
    (ID_POLL, ID_CHOICE, label, votes)
    VALUES (1, SUBSTRING('0', 1, 255), 'It's rather cool, I like what you've done!', 1, 255), '4'),
    (1, SUBSTRING('1', 1, 255), 'This is an ok story, I'm not much into AU though.', 1, 255), '0'),
    (1, SUBSTRING('2', 1, 255), 'It started out great, but then you brought in AU elements :(', 1, 255), '0'),
    (1, SUBSTRING('3', 1, 255), 'It's not all that good, actually, I would rather you work on something else.', 1, 255), '0'),
    (1, SUBSTRING('4', 1, 255), 'I don't like the story, but I'll continue to beta for you since I've told you I would.', 1, 255), '0'),
    (1, SUBSTRING('5', 1, 255), 'Cross me off as a beta for this.', 1, 255), '0'),
    (1, SUBSTRING('6', 1, 255), 'Other (please elaborate with a reply)', 1, 255), '1'),
    (2, SUBSTRING('0', 1, 255), '1 - Run it just like last year!!', 1, 255), '3'),
    (2, SUBSTRING('1', 1, 255), '2 - Make it similar to last year but get rid of the special Fridays.', 1, 255), '0'),
    (2, SUBSTRING('2', 1, 255), '3 - Make the SWSC one large story! (see below for details)', 1, 255), '2'),
    (2, SUBSTRING('3', 1, 255), '4 - Turn it into a round robin! (see below for details)', 1, 255), '1'),
    (2, SUBSTRING('4', 1, 255), '5 - I hate polls... I'll just tell you what I want to do below.', 1, 255), '0'),
    (2, SUBSTRING('5', 1, 255), '6 - I didn't participate last year so anything is fine with me.', 1, 255), '5');

Caused the error:

    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''4'),
    (1, SUBSTRING('1', 1, 255), 'This is an ok story,

There was also a typo: SUBSRING should have been SUBSTRING, which I fixed.

This is driving me nuts, I can't see where the SQL statement is erroring out.

Please help if you can,
Thanks,
-Excalibur

Oldiesmann

Give me a minute to download the converter file and see what's causing the problem. That SUBSTRING statement shouldn't be there - it should look something like this:
(1, '0', SUBSTRING('It\'s rather cool, I like what you\'ve done!', 1, 255), '4'),

instead of this:
(1, SUBSTRING('0', 1, 255), 'It's rather cool, I like what you've done!', 1, 255), '4'),
Michael Eshom
Christian Metal Fans

Oldiesmann

Michael Eshom
Christian Metal Fans

ExcalibursZone

Thanks, but I got past the errors last night by deleting the posts in my IPB forums... That was the only hangup, but I have another forum I need to convert for a friend so I'll see if this one works when that time comes.

Appreciate the help!

altern

I have exactly the same problem :(

What is the correction ?

ExcalibursZone

Did you look above and see the link to download the new .sql file?

Personally, I deleted all the polls, though you shouldn't have to and the file above might have fixed that issue.

altern

Quote from: ExcalibursZone on September 30, 2006, 11:58:10 PM
Did you look above and see the link to download the new .sql file?

Personally, I deleted all the polls, though you shouldn't have to and the file above might have fixed that issue.

Oops ;)

I have try this, but now I have :

Quote
Parse error: parse error, unexpected $ in /home/www/tmp.forum-roadster.com/migr/convert.php(814) : eval()'d code on line 10

Parse error: parse error, unexpected $ in /home/www/tmp.forum-roadster.com/migr/convert.php(814) : eval()'d code on line 10

.....

Unsuccessful!
This query:

    INSERT INTO `FR_v2`.smf_poll_choices
    (ID_POLL, choices)
    VALUES ('1', 'a:10:{i:0;a:3:{i:0;i:0;i:1;s:3:\"BMW\";i:2;i:2;}i:1;a:3:{i:0;i:1;i:1;s:8:\"Caterham\";i:2;i:7;}i:2;a:3:{i:0;i:2;i:1;s:4:\"Fiat\";i:2;i:3;}i:3;a:3:{i:0;i:3;i:1;s:5:\"Honda\";i:2;i:2;}i:4;a:3:{i:0;i:4;i:1;s:5:\"Lotus\";i:2;i:4;}i:5;a:3:{i:0;i:5;i:1;s:5:\"Mazda\";i:2;i:21;}i:6;a:3:{i:0;i:6;i:1;s:2:\"MG\";i:2;i:12;}i:7;a:3:{i:0;i:7;i:1;s:6:\"Toyota\";i:2;i:3;}i:8;a:3:{i:0;i:8;i:1;s:4:\"Opel\";i:2;i:2;}i:9;a:3:{i:0;s:1:\"9\";i:1;s:5:\"Autre\";i:2;i:7;}}'),
    ('3', 'a:4:{i:0;a:3:{i:0;i:0;i:1;s:14:\"Tous les jours\";i:2;i:15;}i:1;a:3:{i:0;i:1;i:1;s:34:\"Uniquement lorsqu'il fait beau\";i:2;i:5;}i:2;a:3:{i:0;i:2;i:1;s:22:\"Uniquement le week-end\";i:2;i:8;}i:3;a:3:{i:0;i:3;i:1;s:42:\"Qu'est-ce que ça peut te foutre !?\";i:2;i:4;}}'),
    ('4', 'a:2:{i:0;a:3:{i:0;i:0;i:1;s:17:\"Oui pourquoi pas.\";i:2;i:2;}i:1;a:3:{i:0;i:1;i:1;s:70:\"Non ! Je loue ou j'achete un vrai pour le revoir plus tard ...\";i:2;i:5;}}'),
    ('5', 'a:3:{i:0;a:3:{i:0;i:0;i:1;s:4:\"Pour\";i:2;i:9;}i:1;a:3:{i:0;i:1;i:1;s:6:\"Contre\";i:2;i:3;}i:2;a:3:{i:0;s:1:\"2\";i:1;s:12:\"Se tate ....\";i:2;i:3;}}'),
    ('6', 'a:5:{i:0;a:3:{i:0;i:0;i:1;s:33:\"A chaque fois que vous vous garez\";i:2;i:7;}i:1;a:3:{i:0;i:1;i:1;s:49:\"Uniquement si vous vous garez pour un long moment\";i:2;i:10;}i:2;a:3:{i:0;i:2;i:1;s:45:\"Uniquement si vous etes loin de votre voiture\";i:2;i:10;}i:3;a:3:{i:0;i:3;i:1;s:18:\"Uniquement le soir\";i:2;i:4;}i:4;a:3:{i:0;i:4;i:1;s:6:\"Jamais\";i:2;i:6;}}'),
    ('7', 'a:2:{i:0;a:3:{i:0;i:0;i:1;s:40:\"Je roule top-up : trop saoulant le bruit\";i:2;i:7;}i:1;a:3:{i:0;i:1;i:1;s:38:\"Je roule top-down : je suis un warrior\";i:2;i:34;}}'),
    ('8', 'a:5:{i:0;a:3:{i:0;i:0;i:1;s:55:\"Utilisation tous deplacements (y compris professionels)\";i:2;i:10;}i:1;a:3:{i:0;i:1;i:1;s:44:\"Utilisation trajet travail/domicil + loisirs\";i:2;i:10;}i:2;a:3:{i:0;i:2;i:1;s:39:\"Utilisation loisirs (avec/sans circuit)\";i:2;i:16;}i:3;a:3:{i:0;i:3;i:1;s:63:\"Utilisation collection, elle dort sous une bache dans le garage\";i:2;i:0;}i:4;a:3:{i:0;i:4;i:1;s:50:\"J'm'en fous, j'en ai pas (de roadster)\";i:2;i:0;}}'),
    ('9', 'a:5:{i:0;a:3:{i:0;i:0;i:1;s:6:\"- Nord\";i:2;i:10;}i:1;a:3:{i:0;i:1;i:1;s:5:\"- Sud\";i:2;i:11;}i:2;a:3:{i:0;i:2;i:1;s:5:\"- Est\";i:2;i:8;}i:3;a:3:{i:0;i:3;i:1;s:7:\"- Ouest\";i:2;i:25;}i:4;a:3:{i:0;i:4;i:1;s:12:\"- Autre pays\";i:2;i:6;}}'),
    ('10', 'a:5:{i:0;a:3:{i:0;i:0;i:1;s:63:\"Non, je suis un warrior je ne mets pas la capote non plus !\";i:2;i:5;}i:1;a:3:{i:0;i:1;i:1;s:40:\"Non, je reste uniquement avec la capote.\";i:2;i:1;}i:2;a:3:{i:0;i:2;i:1;s:23:\"Non, j'en ai pas...\";i:2;i:10;}i:3;a:3:{i:0;i:3;i:1;s:37:\"Oui, t'es malade, ca caille !\";i:2;i:5;}i:4;a:3:{i:0;i:4;i:1;s:22:\"Oui, papy inside !\";i:2;i:2;}}'),
    ('11', 'a:10:{i:0;a:3:{i:0;i:0;i:1;s:49:\"- Tous j'ai eut du bol ou je roule comme Papy\";i:2;i:20;}i:1;a:3:{i:0;i:1;i:1;s:4:\"- 10\";i:2;i:2;}i:2;a:3:{i:0;i:2;i:1;s:21:\"- 9 tiens comme titou\";i:2;i:4;}i:3;a:3:{i:0;i:3;i:1;s:3:\"- 7\";i:2;i:0;}i:4;a:3:{i:0;i:4;i:1;s:34:\"- 6 ca commence à sentir le roussi\";i:2;i:0;}i:5;a:3:{i:0;i:5;i:1;s:21:\"- 4 ou 5 je sais plus\";i:2;i:1;}i:6;a:3:{i:0;i:6;i:1;s:45:\"- 3 plus qu'une ceinture et j'y passe\";i:2;i:0;}i:7;a:3:{i:0;i:7;i:1;s:38:\"- 2 faudrait voir à ce que je me calme\";i:2;i:1;}i:8;a:3:{i:0;i:8;i:1;s:47:\"- 1 c'est décidé je file les clés à bobonne\";i:2;i:0;}i:9;a:3:{i:0;i:9;i:1;s:23:\"- Moi je l'ai paumé\";i:2;i:0;}}'),
    ('12', 'a:4:{i:0;a:3:{i:0;i:0;i:1;s:5:\"- oui\";i:2;i:9;}i:1;a:3:{i:0;i:1;i:1;s:61:\"- à voir sans grande conviction vu qu'on est pas nombreux\";i:2;i:2;}i:2;a:3:{i:0;i:2;i:1;s:35:\"- ca risque de foirer tout de suite\";i:2;i:0;}i:3;a:3:{i:0;i:3;i:1;s:48:\"- non il existe assez de sites sur les anciennes\";i:2;i:1;}}'),

....

Caused the error:

    Unknown column 'choices' in 'field list'

SilverOne78

Same goal (converting IPB 2.0.4) to SMF 1.1 RC2

I've also got the same problem as the previous post.  Tons of lines like this:
Parse error: syntax error, unexpected $end in convert.php(816) : eval()'d code on line 10
followed by the error about 'choices' not being in the field list.

Ofcourse I could add 'choices'   (like I had to add 'memberIP2' to the right table), but the 'eval' errors have me worried.

I tried looking at the changes between the 2 converter .sql files but there were too many for me to quickly determine what the core changes were....

Any help with this is really appreciated.

Oldiesmann

#8
"unexpected $end" means that the file didn't get uploaded properly.
Michael Eshom
Christian Metal Fans

SilverOne78

#9
Well I re-downloaded, and re-uploaded the .sql file and the errors remain.

To be certain, the last lines of the .sql file should be:

SELECT avatar, id AS ID_MEMBER
FROM {$from_prefix}members
WHERE INSTR(avatar, 'upload') != 0;
---*

Right?

Edit:  I think I have found the error....
The following lines are from the new .sql file, and i think the last line is interpreted as a comment, breaking the code block (with the missing } )
Quote
/******************************************************************************/
--- 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)
        {
                $choice = addslashes__recursive($choice);
                $rows[] = "$row[ID_POLL], $choice[0], SUBSTRING('" . $choice[1] . '", 1, 255), $choice[2])";
        }
---}
I tried editing the file to "fix" it, and it does proceed further with the import, but it now complains with several "Error in convert script - line 220!"  lines.   (several different line numbers are in the errors...)

Edit2 - fixed....
I misinterpreted the file format, the bracket is not misplaced.  There is 1 parentheses too many
the correct code is this:  (only showing the last part)
Quote
if (is_array($choices))
        foreach ($choices as $choice)
        {
                $choice = addslashes__recursive($choice);
                $rows[] = "$row[ID_POLL], $choice[0], SUBSTRING('" . $choice[1] . '", 1, 255), $choice[2]";
        }
---}

Or at least I hope it is.  It seems to work....

Oldiesmann

Michael Eshom
Christian Metal Fans

2smooth

Quote from: Oldiesmann on September 28, 2006, 01:15:02 PM
Found the issues... Try this one.

Hi,

I have the same problem, isn't it better to put your fix in the downloadable file in the download section? :)

Oldiesmann

I'll see what I can do. If the new one seems to be working for everyone, then I'll get somebody to slap it up on the downloads page.
Michael Eshom
Christian Metal Fans

2smooth

#13
I know get this error, with the update script i downloaded from this topic:


Converting poll options... Unsuccessful!
This query:

INSERT INTO `my_forum`.smf_poll_choices
(ID_POLL, choices)
VALUES ('9', 'a:2:{i:0;a:3:{i:0;i:0;i:1;s:20:\"www.cu2.nl/simonfld\";i:2;i:0;}i:1;a:3:{i:0;i:1;i:1;s:22:\"patypeeps2002..tallaa\";i:2;i:0;}}'),
...
...
('75', 'a:2:{i:0;a:3:{i:0;i:0;i:1;s:52:\"Ik denk dat hij voor iedereen wel een inspiratie is.\";i:2;i:4;}i:1;a:3:{i:0;i:1;i:1;s:71:\"Maar sommige vinden Bigga gewoon een watje.\";i:2;i:0;}}');
Caused the error:

Unknown column 'choices' in 'field list'




And after trying to fix this error, got this?


Converting poll logs... Unsuccessful!
INSERT INTO `my_forum`.smf_log_polls
(ID_POLL, ID_MEMBER)
VALUES ('', '10'),
('', '3'),
('', '34'),
('', '43'),
('', '47'),
('', '66'),
('', '55'),
('', '54'),
('', '68'),
..
..
('46', '31'),
('46', '2088');
Caused the error:

Duplicate entry '0-34-0' for key 1


And is their a way to speed things op? Because it takes over 4hours to convert, my large database? And the script has failed now for the third time  :(

Oldiesmann

It's not unserializing the data like it should be.

If you make a PHP file with this in it, what do you get?

<?php
echo '<pre>';
$array unserialize(stripslashes('a:2:{i:0;a:3:{i:0;i:0;i:1;s:52:\"Ik denk dat hij voor iedereen wel een inspiratie is.\";i:2;i:4;}i:1;a:3:{i:0;i:1;i:1;s:71:\"Maar sommige vinden Bigga gewoon een watje.\";i:2;i:0;}}'));
print_r($array);
echo 
'</pre>';
?>
Michael Eshom
Christian Metal Fans

2smooth

#15
Quote from: Oldiesmann on October 04, 2006, 06:52:44 PM
It's not unserializing the data like it should be.

If you make a PHP file with this in it, what do you get?


I get this:

<pre></pre>


(a blank page)

Oldiesmann

Either your host has unserialize disabled or it's not working properly.

What happens if you add error_reporting(E_ALL); to the script right below the opening PHP tag?
Michael Eshom
Christian Metal Fans

2smooth

Quote from: Oldiesmann on October 04, 2006, 07:32:53 PM
Either your host has unserialize disabled or it's not working properly.

If this is a setting we can switch this on, becaouse we run our own dedicated server?


QuoteWhat happens if you add error_reporting(E_ALL); to the script right below the opening PHP tag?

We get the same output.. :(
<pre></pre>

2smooth

Quote from: Oldiesmann on October 04, 2006, 06:52:44 PM
It's not unserializing the data like it should be.

If you make a PHP file with this in it, what do you get?


I've run it on a different platform and now you code give this,
And the converter still give the same error.


Array
(
    [0] => Array
        (
            [0] => 0
            [1] => Ja, lijkt me leuk
            [2] => 4
        )

    [1] => Array
        (
            [0] => 1
            [1] => Nee, laat maar
            [2] => 0
        )

)


Oldiesmann

Ok, that's what it's supposed to return. The problem in this case would be that unserialize() isn't working on the server where you're running the converter, so you'll either have to talk to your host or convert on a different server and move everything back over.
Michael Eshom
Christian Metal Fans

Advertisement: