You are here: Re: Apostrophe - when used it mucks with my odbc « PHP Programming Language « IT news, forums, messages
Re: Apostrophe - when used it mucks with my odbc

Posted by Toby A Inkster on 05/14/07 09:14

Johnny BeGood wrote:

> $query = 'INSERT INTO Tasks (TaskType, Details) VALUES ($tasktype,
> $taskdetails)';
> $stmt = odbc_prepare($odbc, $query);
> if (!odbc_execute($stmt, array($tasktype, $taskdetails)))
> {
> echo odbc_errormsg();
> }

As you've already been told, you are using prepared queries incorrectly.

Try:

$query = 'INSERT INTO Tasks (TaskType, Details) VALUES (?, ?);';
$stmt = odbc_prepare($odbc, $query);
if (!odbc_execute($stmt, array($tasktype, $taskdetails)))
{
echo odbc_errormsg();
}

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация