List:General Discussion« Previous MessageNext Message »
From:Grant Peel Date:July 12 2010 3:04am
Subject:Re: Mysql 4 to 5
View as plain text  
----- Original Message ----- 
From: "Grant Peel" <gpeel@stripped>
To: "Michael Dykman" <mdykman@stripped>
Cc: <mysql@stripped>
Sent: Sunday, July 11, 2010 9:25 PM
Subject: Re: Mysql 4 to 5


> ----- Original Message ----- 
> From: "Michael Dykman" <mdykman@stripped>
> To: "Grant Peel" <gpeel@stripped>
> Cc: <mysql@stripped>
> 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 <gpeel@stripped> 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@stripped
> 
> 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=1
> 
> 
>

Mike, UPDATE:

THe backtick worked, thanks for the help!

-Grant

Thread
Mysql 4 to 5Grant Peel12 Jul
  • Re: Mysql 4 to 5Michael Dykman12 Jul
    • Re: Mysql 4 to 5Rudy Lippan12 Jul
  • Re: Mysql 4 to 5Grant Peel12 Jul
  • Re: Mysql 4 to 5Grant Peel12 Jul
  • Re: Mysql 4 to 5Rudy Lippan12 Jul