This question already has answers here:
What is the difference between single-quoted and double-quoted strings in PHP?
                                
                                    (11个答案)
                                
                        
                                2年前关闭。
            
                    
我已经尝试了“一切”使其正常工作,但我没有:-(

$maxcount = 3;
$conn->query("INSERT INTO getal (getal, aantalmaal) SELECT getal, aantalmaal FROM v_topgetallen limit '.$maxcount.'");


你们有什么主意吗?
非常感谢!

最佳答案

尝试这个:

$maxcount = 3;

$conn->query("INSERT
              INTO getal (getal, aantalmaal)
              SELECT getal, aantalmaal
              FROM v_topgetallen
              LIMIT $maxcount");


但请使用准备好的语句。

10-01 09:56