-2

私はphpでこのクエリをしようとしています:

$sql= "SELECT pcampo6 FROM productos WHERE id >= 100";

これは私が得るエラーです:

Invalid query: 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 '= 100' at line 1

私も試しました:

$sql = "SELECT `pcampo6` FROM productos WHERE eliminado=0 AND `id` >= 101";
$sql = "SELECT 'pcampo6' FROM productos WHERE eliminado=0 AND 'id' >= 101";
$sql = "SELECT pcampo6 FROM productos WHERE eliminado=0 AND id >= '101'";
4

1 に答える 1