2017-05-05 43 views
1

我跑了許多的MySQL查詢在PHP用下面的代碼:PHP中可以使用MySQL運行的最大查詢數量是多少?

$this->conection = new mysqli($this->server, $this->user, $this->pass, $this->db); 

$query = "call createNew(....)";//the triple dots represent the parameters, of course, and createNew() is a stored procedure in my database 
$consult = $this->conection->query($query); 

$query2 = "call loadNewID(....)"; 
$consult2 = $this->conection->query($query2); 

$query3 = "call loadNewID(....)";//same stored procedure as the previous one, but with different parameters 
$consult3 = $this->conection->query($query3); 

所以問題是,諮詢和consult2工作就好了,回到「1」,因爲他們應該,但consult3不工作並沒有任何回報。奇怪的是,如果我避免運行query2和consult2行代碼,query3和consult3工作得很好。這就是爲什麼唯一對我有意義的結論是,你可以在一個php文件中運行查詢的限制......有人可能會告訴我,如果我對這個問題是對的還是錯的?或者我該如何解決我的問題,並使所有的查詢工作?

+0

不,不存在這樣的限制,這些將進入隊列。這可能有所幫助,http://stackoverflow.com/questions/41255750/how-does-laravel-store-and-process-the-requests –

+0

'$ this-> conexion-> query()',不應該是'$這 - >連接 - >查詢()'? – creativename

+0

如果查詢一個正在返回預期的結果做一件事是在查詢3之後再次將查詢2置於正常工作並看到查詢2正在返回結果。如果是的話,那麼query3 – Exprator

回答

0

我終於搞定了,夥計們!我叫$ this-> conection-> close();畢竟我的查詢,然後在每次查詢之前再次打開與MySQL的連接,現在它的工作原理:D 感謝您的幫助!

相關問題