Mounarajan Mounarajan - 3 months ago 8
MySQL Question

inserting array values to mysql throws error

I am inserting array values to mysql but it throws some error.

Could not find where does the error occured and where is the error.

Error:

TypeError: 'Connection' object does not support indexing


Where is the error and what is the fix?

Answer

Your db variable contains a Connection object instance. This Connection objects are not indexable, so db[0]....db[n] will not provide any values to be inserted in the SQL query.