How to do multiple queries to SQL

前端 未结 2 556
醉话见心
醉话见心 2021-01-29 06:06

I am trying to create a table and , insert some values in database with help of PHP script. While inserting only 1 row , it works fine. An when I try to enter more number of row

2条回答
  •  借酒劲吻你
    2021-01-29 07:02

    An easier approach could be to split the string with ; and iterate of each query in the array. Execute all of them one by one..

    $sqlCommandArray[]=explode(";",$sqlCommand);
    
    for($i=0;$i

    This would do the job without any modifications.

     $query = mysqli_multi_query($db_conx,$sqlCommand);
    

提交回复
热议问题