|
|
Choosing A Webhost: |
Re: freetds, php, cron: msg#00168db.tds.freetds
What language are you using for your script insertion? Perl or PHP? For PHP you need to use the addslashes() function to escape characters for Perl you need to hmmmm...lemme try and remember. Or this for perl... the quote() function being the fixer of the problem. $dbh=DBI->connect('DBI:mysql:my_db:my_host', 'username', 'password'); $string=$dbh->quote("$string"); my $squery='INSERT into my_table (column) values ($string)'; my $sql=$dbh->prepare($squery); $sql->execute; $dbh->disconnect; HTH, Eddie --- Oliver Baden <obaden@xxxxxxxx> wrote: > Hi! > > I have a problem when running a script via cron which > inserts records in a mssql-database . The moment (I > assume) a varchar-field contains characters like !-=<> > the statement breaks with an error-message that there > are either too many fields in the statement or that > the syntax is incorrect. It seems that these > characters are interpreted as an apostrophe. > > Running the script interactively it works fine. > > I also assume that the first record in the loop also > works no problem. Only during the second or third > insert the statement breaks. > > Thanks! > > Oliver Baden > > > > __________________________________________________________________ > > Gesendet von Yahoo! Mail - http://mail.yahoo.de > Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de > _______________________________________________ > FreeTDS mailing list > FreeTDS@xxxxxxxxxxxxxxxxx > http://lists.ibiblio.org/mailman/listinfo/freetds
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | freetds, php, cron, Oliver Baden |
|---|---|
| Next by Date: | RE: ODBC patch, Peter Deacon |
| Previous by Thread: | freetds, php, cron, Oliver Baden |
| Next by Thread: | AW: freetds, php, cron, Oliver Baden |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |