$result = tep_db_query("SELECT products_image FROM products where products_model =" . $isbn);
I am trying to test whether any record with products_model = ... already exists.
Is there any better way to do the test, instead of accessing a record?
what is wrong with this statement?
Moderator: General Moderators
Re: what is wrong with this statement?
What is the problem? Is it returning some error? The query looks fine at a glance, though I have no idea what tep_db_query is.
Re: what is wrong with this statement?
tep_db_query is a function of OSCommerce. I did not remove it, before I post, in case that makes difference.Celauran wrote:What is the problem? Is it returning some error? The query looks fine at a glance, though I have no idea what tep_db_query is.
It simply pass a query string to MySQL
The table has an auto-increase index and a unique field products_model.
The error message appeared in the XHR
<font color="#000000"><strong>1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1<br /><br />SELECT products_image FROM products where products_model =<br /><br /><small><font color="#ff0000">[TEP STOP]</font></small><br /><br /></strong></font>