Code: Select all
$result = mysql_query ("SELECT number, category, id, title FROM products WHERE pause = 'off' and number > '50' ORDER BY number DESC");
I need to ensure that this query pulls out info ONLY if the 'number' field has something in it, but also, only if it is a numeric output. The field does have occasionally "alpha" characters in there instead, where the owner states the information is not available at the moment. So I only want to get the info if it does have 100, 200, or whatever figure has been entered.
I thought it would be something like this:
Code: Select all
$result = mysql_query ("SELECT number, category, id, title FROM products WHERE pause = 'off' and number IS NUMERIC ORDER BY number DESC");
.... but it doesn't work. Doesn't produce anything at all.