开发者

trying to use SOUNDEX in query but getting an error in terms of database columns in mysql

Trying to figure out what went wrong, must be a silly syntax.

$objDatabase = QApplication::$Database[1];
$strQuery = 'UPDATE `account` SET `sndx`=SOUNDEX("'.$objAccount->Name.'") WHERE `Id`='.$aid;
$objDbResult = $objDatabase->Query($strQuery);

The error I get is:

MySqli Error: Unknown column 'sndx' in 'field list' Exception Type: QMySqliDatabaseException

There 开发者_如何转开发is no sndx column. The intent is to match values in account using SOUNDEX....


Well, you've answered your own question. If there is no sndx column, you can't set a value to it which is why the query fails.

Update your table to have an sndx column.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜