如何使用一个SQL查询创建多个表

时间:2016-09-02 11:08:31

标签: php mysql

我要为我的网站准备一个安装脚本,该脚本会自动创建数据库及其表格。 如何将每个查询一起发送? 这是PHP代码:

  @Override
        public boolean isEnabled(int position){
            if(position == 0)
            {
                // Disable the first item "Select Item" from Spinner
                // First item will be use for hint
                return false;
            }
            else
            {
                return true;
            }
        }
        @Override
        public View getDropDownView(int position, View convertView,ViewGroup parent) {
            View view = super.getDropDownView(position, convertView, parent);
            TextView tv = (TextView) view;
            if(position == 0){
                // Set the hint "Select Item" text color gray
                tv.setTextColor(Color.GRAY);
            }
            else {
                tv.setTextColor(Color.BLACK);
            }
            return view;
        }
    };

谢谢。

2 个答案:

答案 0 :(得分:1)

使用mysqli,您可以使用多个语句实现mysqli_multi_query()

详细了解PHP Docs中的多个语句。

答案 1 :(得分:0)

  

如何将每个查询发送到一个?

你不能。

您需要在单独的php调用中发送每个查询。