tags:

views:

37

answers:

3

here my code-

$sqlpin = "SELECT pinId FROM tblpin WHERE pinId = '$pin_no', status = 0 ";

status is int type.
it is showing parse error.

+6  A: 

SELECT pinId FROM tblpin WHERE pinId = '$pin_no' AND status = 0

zed_0xff
when shoul I use `status = '0'` or `status = "0"`
pamela
it does not matter. quotes are significant for strings, ints can be used with any quotes, or even without them.
zed_0xff
When should you use quotes around numeric values? The answer is NEVER.
Josh Davis
A: 

Have you tried?

$sqlpin = "SELECT pinId FROM tblpin WHERE pinId = '$pin_no' and status = 0 ";
The MYYN
when shoul I use `status = '0'` or `status = "0"`
pamela
A: 

Syntax error is caused by comma in WHERE clause. You should use AND logical operator to connect these two conditions.

btw: If some column has numeric type don't pass values with apostrophes, just: colName = 123. Only text values requires apostrophes/quotes (in MySQL both has exactly the same meaning).

Crozin