使用数组插入表中以获取字段名称和值 [英] Insert into table using arrays for field names and values

查看:91
本文介绍了使用数组插入表中以获取字段名称和值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个论坛上找到了我的问题的一些答案,但不完全是我正在寻找的答案。对不起,如果我错过了什么。


这是我的情况:


我试图插入MySQL表,使用数组作为字段列表,使用另一个数组作为值。我知道你不能只使用:

I''ve found some answers to my problem on this forum, but not exactly the answer I was looking for. Sorry if I''ve missed something.

This is my situation:

I am trying to make an insertion into an MySQL table, using an array for the field list AND another array for the values. I know by know that you can''t just use:

展开 | 选择 | Wrap | 行号

推荐答案

欢迎使用脚本!


请将您发布的代码附在[code]标签中(参见如何提问)。


这使我们的专家更容易阅读和理解它。如果不这样做会给版主带来额外的工作,从而浪费资源,否则可以回答会员的问题。


请将来使用[code]标签。


MODERATOR
Welcome to The Scripts!

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members'' questions.

Please use [code] tags in future.

MODERATOR


这个问题很重要:

两个数组的条目都是1-1,即做相关条目的索引在两个数组中都有相同的数字?例如。是
Important question on this:
Are the entries of both arrays 1-1, i.e. do the indices of related entries have the same number in both arrays? E.g. is


array1 [4]与
array1[4] related to

相关

这篇关于使用数组插入表中以获取字段名称和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆