Re: access insert problem

From: Date: Thu, 01 Feb 2001 11:02:45 +0000
Subject: Re: access insert problem
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6308@lists.php.net to get a copy of this message
Fredrik Stark wrote:
Hi, Im using php4.0.3pl1 on a NT5 with an Access 2000 database. I use the database to store text and numbers. I just realised that the text-field can only store 255 characters so I changed the type from "text" to "memo". And now i get "Syntax Error" when i try to insert a value to the "memo" field... Anyone got a solution? /stark
You probably can't pass your value literally. Try using SQL Parameters: <?php $stmt = odbc_prepare($conn, "insert into foo (memocolumn, numbercolumn) values(?,?)"); $parameters[] = "Some long text"; $parameters[] = 123; odbc_execute($stmt,$parameters); ?> See also the manual entries for odbc_prepare() / odbc_execute(). -Andreas -- Andreas Karajannis mediaworx berlin AG Fon (0 30) 2 75 80 - 266 Fax (0 30) 2 75 80 - 200

« previous php.db (#6308) next »