That happens for this reason :
The function
dbDelta
can receive as first parameter ($queries
) an array or a string. If$queries
is a string,dbDelta
will make an array with “;” as delimiter.
inside dbDelta
if ( !is_array($queries) ) {
$queries = explode( ';', $queries );
$queries = array_filter( $queries );
}
So the solution is to make an array of queries instead of a string as a first parameter like this:
myFunction(){
...
$query_string = array(
0 => "INSERT INTO {$table_name} {$str_column_names} VALUES {$str_values}"
);
dbDelta( $query_string );
}
The answer was found here.
Related Posts:
- When is K 1024 and when is it 1000?
- Dial pad to get phone number (with Android button images)
- Why is it not possible to fake an IP address?
- Authentication versus Authorization
- What is tail recursion?
- How to get rid of the “No bootable medium found!” error in Virtual Box? [closed]
- ‘git’ is not recognized as an internal or external command
- what is svn? and how to use it with project?
- How can I write a `try`/`except` block that catches all exceptions?
- How to write trycatch in R
- how to use proxy on youtube-dl?
- SSH -X “Warning: untrusted X11 forwarding setup failed: xauth key data not generated”
- LINQ equivalent of foreach for IEnumerable
- How to do vlookup and fill down (like in Excel) in R?
- Using “super” in C++
- What is the difference between application server and web server?
- Were jprobes removed from kernel v4?
- ldap_sasl_bind(SIMPLE): Can’t contact LDAP server(-1)
- PHP – Failed to open stream : No such file or directory
- How to extract the substring between two markers?
- Code-first vs Model/Database-first
- How to resolve git’s “not something we can merge” error
- Even though JRE 8 is installed on my MAC -” No Java Runtime present,requesting to install ” gets displayed in terminal
- What fonts can I use with pygame.font.Font?
- CSS Box Shadow Bottom Only
- How to squash all git commits into one?
- how to fix Javac invalid flag error?
- Web API Error – This request has been blocked; the content must be served over HTTPS
- How can I delete all of my Git stashes at once?
- How to create temp table using Create statement in SQL Server?
- Error while trying to retrieve text for error ORA-01019
- What is meant by diameter of a network?
- What is the “N+1 selects problem” in ORM (Object-Relational Mapping)?
- HTML Best Practices: Should I use ’ or the special keyboard shortcut?
- What is runtime in context of Python? What does it consist of?
- mount.nfs: requested NFS version or transport protocol is not supported
- how to use svm in Weka Classsifier?
- MIPS ‘nor’ usage in code
- How can I center
- into a div?
- Popup window in PHP?
- LaTeX table too wide. How to make it fit?
- R Markdown – changing font size and font type in html output
- git add only modified changes and ignore untracked files
- HTTP Error 404.3-Not Found in IIS 7.5
- What is the difference between procedural programming and functional programming?
- Multiplying a register value by a constant in MIPS?
- What’s the use of the staging area in Git?
- Getting DOM element value using pure JavaScript
- What is the difference between lemmatization vs stemming?
- Instagram how to get my user id from username?
- Procedural and non-procedural query language difference
- COM object that has been separated from its underlying RCW cannot be used
- Swift 2: !, ? -” Value of optional type “…” not unwrapped”
- R: NaNs produced
- What is a .meta file and why does Unity create them for all of my assets?
- Center div on the middle of screen [duplicate]
- Which function grows faster, exponential or factorial?
- How to calculate Internet checksum?
- How to get the vector between two vectors?
- Brackets.io in built support for TypeScript
- XML Error: Extra content at the end of the document
- ggplot facet_wrap: At least one layer must contain all variables used for facetting
- How to define composite keys with dbDelta()
- Problems with DBDelta with FOREIGN key?
- Custom database table for plugin not creating on activation
- Problem in creating table through plugin code
- Child theme on style.min.css
- dbDelta using Foreign key not working on update [duplicate]
- dbDelta not installing database
- Why my query ‘REPLACE INTO…’ does not work?
- Add Woocommerce product to cart with Contact Form 7 [closed]
- How can I prevent the WordPress Importer from munging double-newline paragraph breaks to a single newline?
- Slow WP Site, theme.php not caching? Up to 25 second load time! [closed]
- cant insert data in a custom table in phpmyadmin
- A Compare And Distinction Essay Define To Beat Writer’s Block
- 27 Outstanding Faculty Essay Examples
- The Way To Write An Essay Outline In Four Steps
- How to hide subfolder of static pages in WordPress using htaccess
- To remove rendering of menus and header, plugin or theme?
- What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?
- How to set environment variable in systemd service?
- Symlink not updating as expected when using an absolute with relative path
- How to include multiple domains in an spf TXT Record
- Physically locating the server
- Good tools that fit on a thumb drive [closed]
- How do you answer yes for yum install automatically
- All servers flooded by salt water, is it possible to recover data from multi-platter drives?
- How to check if I’m in screen session?
- How to zip/unzip files in Powershell?
- Cooling Server Closet – No A/C Is Possible
- Is it better practice to buy RAID disks individually vs. in bulk?
- What range of MAC addresses can I safely use for my virtual machines?
- What sysadmin things should every programmer know?
- Why do systems generally disable virtualization by default in BIOS settings?
- 10 servers to administer and I’m a history major [closed]
- Making `wget` not save the page
- How do I list all connected Salt Stack minions?
- How to get Apache2 to redirect to a subdirectory
- What does that mean: packages excluded due to repository priority protections
- How can I set a short timeout with the ping command?