Answer the question
In order to leave comments, you need to log in
How to determine if a record exists in a MySQL database?
Why is 1 returned to me, although there are no records in the database on request? The code is:
querySQL := 'SELECT COUNT(*) `article` FROM `sdvd_products` WHERE `article` = "'+article+'"';
qQuery.SQL.Clear;
uti := qQuery.SQL.Add(querySQL);
if uti = 0 then
ShowMessage('The specified entry '+article+' does not exist!')
else
begin
qQuery.SQL.Clear;
qQuery.SQL.Add('UPDATE `sdvd_products` SET `price` = :_price WHERE `article` = "'+article+'"');
qQuery.ParamByName('_price').Value := price;
qQuery.ExecSQL;
end;
what's wrong?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question