Mysql 4 to 5
am 12.07.2010 01:50:13 von Grant Peel
------=_NextPart_000_0058_01CB2132.47341C70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I recently migrated a script called perldesk from mysql 4 to mysql 5.=20
When I envoke the script from the web, I am now getting an error. I =
suspect its a version syntax thing.
Here is what I see:
Couldn't execute statement: 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 'call =3D '1307' ORDER BY id' at line 1; =
stoppedContent-type: text/html=20
PerlDesk: Script Error=20
=20
Perldesk was unable to launch due to the following errors:=20
1 at include/staff_subs.cgi line 1401.=20
=20
line 1401 is the third line below:
$statemente =3D 'SELECT * FROM notes WHERE call =3D ? ORDER BY =
id;';
$sth =3D $dbh->prepare($statemente) or die print "Couldn't =
prepare statement:$DBI::errstr; stopped";
$sth->execute($trackedcall) or die print "Couldn't execute =
statement: $DBI::errstr; stopped";
Any help on how to fix this would be appreciated,
-G
------=_NextPart_000_0058_01CB2132.47341C70--
Re: Mysql 4 to 5
am 12.07.2010 03:20:11 von Michael Dykman
One problem you might be having is the column named 'call'.. It's a
keyword, so perhaps you might get away with backticking it? ie.
`call`
Also, you shouldn't need that final semi-colon inside your statement
string.. I have had preparedstatement interfaces give me grief about
that.
As I recall, DBI doesn't attempt to validate the statement until execute ti=
me.
$statemente =3D 'SELECT * FROM notes WHERE call =3D ? ORDER BY id;';
$sth =3D $dbh->prepare($statemente) or die print "Couldn't
prepare statement:$DBI::errstr; stopped";
$sth->execute($trackedcall) or die print "Couldn't execute
statement: $DBI::errstr; stopped";
- md
On Sun, Jul 11, 2010 at 7:50 PM, Grant Peel wrote:
> Hi all,
>
> I recently migrated a script called perldesk from mysql 4 to mysql 5.
>
> When I envoke the script from the web, I am now getting an error. I suspe=
ct its a version syntax thing.
>
> Here is what I see:
>
> Couldn't execute statement: You have an error in your SQL syntax; check t=
he manual that corresponds to your MySQL server version for the right synta=
x to use near 'call =3D '1307' ORDER BY id' at line 1; stoppedContent-type:=
text/html
>
>
> =A0 =A0 =A0PerlDesk: Script Error
>
> =A0 =A0 =A0Perldesk was unable to launch due to the following errors:
>
> =A0 =A0 =A01 at include/staff_subs.cgi line 1401.
>
>
> line 1401 is the third line below:
>
>
> =A0 =A0 =A0 =A0$statemente =3D 'SELECT * FROM notes WHERE call =3D ? ORDE=
R BY id;';
> =A0 =A0 =A0 =A0$sth =3D $dbh->prepare($statemente) or die print "Couldn't=
prepare statement:$DBI::errstr; stopped";
> =A0 =A0 =A0 =A0$sth->execute($trackedcall) or die print "Couldn't execute=
statement: $DBI::errstr; stopped";
>
> Any help on how to fix this would be appreciated,
>
> -G
--=20
=A0- michael dykman
=A0- mdykman@gmail.com
=A0May the Source be with you.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Mysql 4 to 5
am 12.07.2010 03:25:51 von Grant Peel
----- Original Message -----
From: "Michael Dykman"
To: "Grant Peel"
Cc:
Sent: Sunday, July 11, 2010 9:20 PM
Subject: Re: Mysql 4 to 5
One problem you might be having is the column named 'call'.. It's a
keyword, so perhaps you might get away with backticking it? ie.
`call`
Also, you shouldn't need that final semi-colon inside your statement
string.. I have had preparedstatement interfaces give me grief about
that.
As I recall, DBI doesn't attempt to validate the statement until execute
time.
$statemente = 'SELECT * FROM notes WHERE call = ? ORDER BY id;';
$sth = $dbh->prepare($statemente) or die print "Couldn't
prepare statement:$DBI::errstr; stopped";
$sth->execute($trackedcall) or die print "Couldn't execute
statement: $DBI::errstr; stopped";
- md
On Sun, Jul 11, 2010 at 7:50 PM, Grant Peel wrote:
> Hi all,
>
> I recently migrated a script called perldesk from mysql 4 to mysql 5.
>
> When I envoke the script from the web, I am now getting an error. I
> suspect its a version syntax thing.
>
> Here is what I see:
>
> Couldn't execute statement: 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 'call = '1307' ORDER BY id' at line 1;
> stoppedContent-type: text/html
>
>
> PerlDesk: Script Error
>
> Perldesk was unable to launch due to the following errors:
>
> 1 at include/staff_subs.cgi line 1401.
>
>
> line 1401 is the third line below:
>
>
> $statemente = 'SELECT * FROM notes WHERE call = ? ORDER BY id;';
> $sth = $dbh->prepare($statemente) or die print "Couldn't prepare
> statement:$DBI::errstr; stopped";
> $sth->execute($trackedcall) or die print "Couldn't execute statement:
> $DBI::errstr; stopped";
>
> Any help on how to fix this would be appreciated,
>
> -G
--
- michael dykman
- mdykman@gmail.com
May the Source be with you.
Thanks Mike, I will try that :-)
-G
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Mysql 4 to 5
am 12.07.2010 05:04:55 von Grant Peel
----- Original Message -----
From: "Grant Peel"
To: "Michael Dykman"
Cc:
Sent: Sunday, July 11, 2010 9:25 PM
Subject: Re: Mysql 4 to 5
> ----- Original Message -----
> From: "Michael Dykman"
> To: "Grant Peel"
> Cc:
> Sent: Sunday, July 11, 2010 9:20 PM
> Subject: Re: Mysql 4 to 5
>
>
> One problem you might be having is the column named 'call'.. It's a
> keyword, so perhaps you might get away with backticking it? ie.
> `call`
>
> Also, you shouldn't need that final semi-colon inside your statement
> string.. I have had preparedstatement interfaces give me grief about
> that.
>
> As I recall, DBI doesn't attempt to validate the statement until execute
> time.
>
> $statemente = 'SELECT * FROM notes WHERE call = ? ORDER BY id;';
> $sth = $dbh->prepare($statemente) or die print "Couldn't
> prepare statement:$DBI::errstr; stopped";
> $sth->execute($trackedcall) or die print "Couldn't execute
> statement: $DBI::errstr; stopped";
>
> - md
>
> On Sun, Jul 11, 2010 at 7:50 PM, Grant Peel wrote:
>> Hi all,
>>
>> I recently migrated a script called perldesk from mysql 4 to mysql 5.
>>
>> When I envoke the script from the web, I am now getting an error. I
>> suspect its a version syntax thing.
>>
>> Here is what I see:
>>
>> Couldn't execute statement: 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 'call = '1307' ORDER BY id' at line 1;
>> stoppedContent-type: text/html
>>
>>
>> PerlDesk: Script Error
>>
>> Perldesk was unable to launch due to the following errors:
>>
>> 1 at include/staff_subs.cgi line 1401.
>>
>>
>> line 1401 is the third line below:
>>
>>
>> $statemente = 'SELECT * FROM notes WHERE call = ? ORDER BY id;';
>> $sth = $dbh->prepare($statemente) or die print "Couldn't prepare
>> statement:$DBI::errstr; stopped";
>> $sth->execute($trackedcall) or die print "Couldn't execute statement:
>> $DBI::errstr; stopped";
>>
>> Any help on how to fix this would be appreciated,
>>
>> -G
>
>
>
> --
> - michael dykman
> - mdykman@gmail.com
>
> May the Source be with you.
>
>
> Thanks Mike, I will try that :-)
>
> -G
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=gpeel@thenetnow.com
>
>
>
Mike, UPDATE:
THe backtick worked, thanks for the help!
-Grant
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Mysql 4 to 5
am 12.07.2010 05:30:26 von Rudy Lippan
Grant Peel wrote:
> Hi all,
>
> I recently migrated a script called perldesk from mysql 4 to mysql 5.
>
> When I envoke the script from the web, I am now getting an error. I suspect its a version syntax thing.
>
> Here is what I see:
>
> Couldn't execute statement: 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 'call = '1307' ORDER BY id' at line 1; stoppedContent-type: text/html
>
>
> PerlDesk: Script Error
>
> Perldesk was unable to launch due to the following errors:
>
> 1 at include/staff_subs.cgi line 1401.
>
>
> line 1401 is the third line below:
>
>
> $statemente = 'SELECT * FROM notes WHERE call = ? ORDER BY id;';
> $sth = $dbh->prepare($statemente) or die print "Couldn't prepare statement:$DBI::errstr; stopped";
> $sth->execute($trackedcall) or die print "Couldn't execute statement: $DBI::errstr; stopped";
WTF? If this sample is indicative of the quality of the rest of
PerlDesk, I'd seriously reconsider allowing it anywhere near my servers
until a full review of the code was performed.
>
> Any help on how to fix this would be appreciated,
I'd recommend that you either contact the vendor for support or forgo
upgrading mysql. I assume that the software was tested with mysql 4 so
you probably should continue to use that until you get a version of the
software that supports mysql 5. You might fix this one problem, but who
knows what other incompatibilities are lurking in the code (and will
bite you at the worst possible time)
-r
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Mysql 4 to 5
am 12.07.2010 05:47:15 von Rudy Lippan
Michael Dykman wrote:
> One problem you might be having is the column named 'call'.. It's a
> keyword, so perhaps you might get away with backticking it? ie.
> `call`
>
> Also, you shouldn't need that final semi-colon inside your statement
> string.. I have had preparedstatement interfaces give me grief about
> that.
>
> As I recall, DBI doesn't attempt to validate the statement until execute time.
DBI does not get involved with the validation of the statement; it
leaves that to the database driver (DBD).
Not getting any feedback until execute might have been true for earlier
version of DBD::mysql because they did not support server-side prepared
statements (BTA, neither did mysql itself...). These days you should
get feedback when preparing the statement (assuming your server
supports it and it is enabled in the driver).
-r
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org