插入忽略查询

时间:2016-09-02 06:48:39

标签: mysqli insert ignore

大家好我正在尝试这个 - 当用户点击提交按钮我将一些数据插入我的数据库但我不知道它为什么不插入。

有人可以在此代码中看到一些错误(不会出错):

 if(isset($_POST['submit']))
 {
    $flowernameid = $_POST['reg_flowertype'];
    $_SESSION["flowernameid"] = $flowernameid;
    $joinquery = mysqli_query($conn,"SELECT c.id as country_id,c.name as country_name,f.id as flower_id, ft.id as flowertype_id FROM tbl_countries c JOIN tbl_flower f JOIN tbl_flowertypes ft ON ft.name = f.flower_type WHERE f.id ='$_SESSION[flowernameid]'");
    while($row = $joinquery -> fetch_assoc())
    {
            mysqli_query($conn,"insert ignore into tbl_boostprice (country_id,flowertype_id,flowername_id,boostprice) values(".$row['country_id'].",".$row['flowertype_id'].",".$row['flower_id'].",0)");
    }
 }

谢谢。

0 个答案:

没有答案