Hot answers tagged mysql
4
If your data is inside database as I understand, it is possible to export your database to CSV file and import this to Wordpress. CSV file is basically a comma separated list of data from your database that makes it possible to transfer data from different database structure to another.
It does indeed take some effort to configure your export/import so that ...
2
As @s_ha_dum mentioned in the comments, building an API or some sort of XML or JSON feed (or leveraging one that's already there, or installing a plugin on whatever system that is, etc) is really your only way of getting at that data remotely. Once you get that going, you can use wp_remote_get to query the API.
To make this question a little more WordPress ...
2
It seems like the crux of the question is this:
This causes the first 'if' condition to return TRUE and it inserts a
duplicate post.
Check for the post_name instead. That value is normalized to lowercase and dashes by sanitize_title_with_dashes so you won't have this issue. That value is also the one that WordPress enforces as unique, and the one ...
2
Wordpress is an ecosystem of its own, and it's pretty fat in terms of memory use and existing APIs and structures.
Integrating this huge behemoth with a lean back-end that you have already built on your own won't make much sense unless you specifically want to use WP's back-end functionality instead of yours.
WordPress themes are just HTML, CSS, and ...
2
This is essentially a SQL question. The only possible WordPress related component would be if you were asking about database structure, which is in the Codex. Or you could just look at the database itself.
The post ID is incremented and never duplicated. The highest IDs are the last added. The query is simple.
SELECT *
FROM {$wpdb->posts}
WHERE ...
1
512MB should be fine, especially if you just started building your site.
I've ran single WP installs on DigitalOcean droplets with 512MB of RAM without any issues in the past, also on NginX. Obviously, server stability also greatly depends on how NginX, MySQL etc have been configured (ie. not to consume too much memory and such)
Have you installed any ...
1
Wordpress has its own connection class, which can be used trough the $wpdb object.
Is there a particular reason to use direct queries to the db, instead the wordpress functions (get_posts, get_post_meta, get_option)? Keep in mind that by doing this, you loose a lot of the wordpress tools, such as cache, filters, etc...
1
IMHO that would depend on the hosting company and what resources you are limited to.
Let's say you pick Amazon's MySQL RDS. There are seven server models permitted. Each model allows a maximum value for the number of connections.
I wrote a post about this last month in the DBA StackExchanage : Should I increase max_connections in AWS RDS t1-micro for ...
1
Be sure you have updated your database to reflect the correct URL. You can do this in phpmyadmin with a bit of SQL. Good article about it here:
http://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database
1
Following the recomendations of @toscho i had a look at get_results and the following edits to the function ended up doing the trick.
if ( ! function_exists( 'get_meta_values' ) ) {
function get_meta_values( $key = '', $type = 'post', $status = 'publish' ) {
global $wpdb;
if( empty( $key ) )
return;
$r = ...
1
Your question is more about SQL than WordPress.
If you want to sort your term names as numbers, you can in general try
SELECT * FROM wp_terms ORDER BY name+0 ASC
or
SELECT * FROM wp_terms ORDER BY name*1 ASC
or use CAST:
SELECT * FROM wp_terms ORDER BY CAST(name AS SIGNED) ASC
where you can use SIGNED, UNSIGNED or maybe DECIMAL(10,2), just ...
Only top voted, non community-wiki answers of a minimum length are eligible
