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.
精彩评论