How to make a insert variables in this query?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
$query='SELECT*FROM answer WHERE title="'.$row['title'].'" ORDER BY id DESC LIMIT "'.$art.'", "'.$kol.'"';
Error 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 '"0", "3"' at line 1
by | 11 views

2 Answers

0 like 0 dislike
sprintf? And the Limit must be a numeric value, and you get a string senrice, i.e. remove the double quotes.
by
0 like 0 dislike
The best option would be to use placeholder's.
But in your case you can:
$query = "SELECT * FROM answer WHERE title='{$row['title']}' ORDER BY id DESC LIMIT {$art}, {$Col}";
by

Related questions

0 like 0 dislike
1 answer
asked Jun 2, 2019 by MetisKot
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked May 21, 2019 by dmitriu256
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 9, 2019 by ART4
110,608 questions
257,186 answers
0 comments
36,485 users