Tag Info

New answers tagged

1

can I just create one using PHPMYADMIN ? Yes.You can. And its a shortest way to do it.


1

I didn't do this recently but in 2014, in a few WordPress projects that I need additional tables I used Laravel components. In WordPress, if you want to create your own tables by using wpdb and mysql queries. But with the Laravel database classes I managed to do this much more elegantly. A quick rundown how I do this: (note: At the time, I used Laravel 4 ...


2

When I started out with Wordpress I was anti-plugin. I wanted to add everything in my theme's functions.php. When I looked at the bigger picture it began making sense having and leaving some functionalities inside a plugin. There are many write-ups on the subject of what should go into a plugin and what should go into a theme. I, for one, have done one or ...


1

As the codex says, it is legacy with probably no use in any modern version. I have been around wordpress since 2.0.4 and I don't remember it being used or referenced so my guess is that it is a really old legacy thing.


0

I suggest for you some ideas : Before run functions from you make, you register table database store ( Example WP_IP and WP_UTM ) After create 2 table that, you run function of you You need read on Codex some resource on WP working with parameters : https://codex.wordpress.org/Class_Reference/wpdb https://codex.wordpress.org/Creating_Tables_with_Plugins


0

For me it was permissions of the DB user and the DB. They were too strict, once I gave the user ALL privileges, I was able to get passed the loop. Either fix the user permissions of your SQL user, or use root if you have access to that SQL user.


0

I forgot that I have set a password for MySQL when setting up Uniform Server Zero XI for the first time. I simply added that password to the wp-config.php file and now installation works. It was this comment that lead to the solution in the end: Getting "Error Establishing a Database Connection" on localhost in new Mac OSX Lion environment Thank ...


-1

Make sure your user has permission to publish. Some WordPress setups users such as authors do not have permission to publish posts directly, instead they can submit them for review for an admin to review and decide whether the post should be published or not. It is not a great idea to use an administrator user on daily basis so sometimes people create an ...


2

This error: Fatal error: Call to a member function insert() on a non-object Means that $wpdb isn't instantiated so you are running your code too early or out of WordPress context-- for example, in an exterior PHP file accessed directly, which is what I suspect (Poorly conceived AJAX request perhaps?). As mentioned, the code has more formats that data ...


1

Your problem is that serialized strings contains escape slashes that are not evaluated as such, because the wrapping quote is a single quote. You are using: $v = 'a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}'; // wrong You have to use either $v = "a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}"; // ok or $v = 'a:2:{i:0;b:0;s:8:"auto_add";a:0:{}}'; // ok By the ...


0

You don't create "apps" in WordPress. I'm guessing but it sounds to me like you are thinking of WordPress as something similar to Rails or Django. It isn't like that. WordPress is a web application. You would create a theme or a plugin to extend that application. In your case you almost certainly want a plugin. Once you have that you have database access ...


0

Brandoo WordPress was abandoned. I've now moved to Nami WordPress which is similar. It also works with SQL Server and is more actively developed.


1

Brandoo isn't (sadly) hosted by Azure at the moment. This plugin is written to be used by version 3.6. Newer versions make use of queries which will not work on SQL Server. That's why you get those errors. So, you need to keep your version of wordpress at all costs till a newer version of brandoo is released: ...


2

With everything moving towards OOP programming with classes and the use of objects increasing and favored above the use of arrays as such, I would definitely go with returning results as an object. This just makes everything easier for future use But at the end of the day, you should always use what you are comfortable with within a set scope while keeping ...


1

I notice that to link to each post, I am calling get_permalink() and this is creating an extra DB query for each post. Not true. If you check the link to the very old trac ticket #18822 in the post that you have linked to, this issue was raised by @kaiser in 2011. The question was answered by @scribu For example: $posts = get_posts(); foreach ( ...


0

In short, this is serialized data and this is how data is stored from a custom field (and many other datastrings) in the db. s:114 is auto generated and simply means that the value http://localhost/wp-content/uploads/woocommerce_uploads/2014/09/test-file.pdf is a string and is 114 characters long. This is used when the data is read and used. If the URL ...


0

You can save post meta with the same meta key, just set the $unique parameter to false. if(isset($_POST['save'])){ foreach ($_POST as $post_key => $post_value){ if ( 'save' === $post_key ) continue; if ( is_array($post_value) ) { foreach ( $post_value as $key => value ) { ...


0

I finally got it by changing the db value in wp_options table and it works like a charm


0

You can insert as many variables as you want (%digit, %string ...) global $wpdb; $zz = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = '%s' WHERE post_id = '%d' OR WHERE post_id = '%d' ", $value, $id_1, $id_2 ) ); var_dump($zz); exit;


0

If you get that Database update message, looks like WordPress may have updated. Probably you want to turn automatic updates off. Simply do: 1 - Restore your db where it works ok 2 - Add this to your wp-config.php: define( 'AUTOMATIC_UPDATER_DISABLED', true ); 3 - Enjoy!


0

You have destroyed a significant section of your database. Unless you have a backup you cannot get it back. What happened when you changed the varchar to an int was that every entry not recognized as an integer was converted to 0. You can see that in your screenshot. That is not reversible. Data was lost. In the future: Make a backup Don't mess with ...


0

Just to check the basics first: have you already gone into 'Screen options' at top right? After you click that tab, is your custom post type listed there with a checkbox? If not then you know it's something in the code (if it's there unchecked, tick the box and it should appear in edit page).


0

Sounds like UAC crap. Permissions on windows are always a pain. Have you been logging in as administrator? Are you able to FTP and drop in an up to date version of the core files(everything but wp-config.php and the wp-content folder)? Or do you have RDP access on that box? You might find it easier to get in and delete and replace things that way.


0

Error -1 is fairly broad, but has a few common causes: A full disk Memory or resource issues on the server (check mysql logs) Database Corruption (run checks on the database tables) If the issue winds up being database corruption, you will want to follow the repair procedures for the storage engine used for the corrupted tables. If all else fails, roll ...


0

if you want to keep the row with the lowest id value: DELETE n1 FROM table n1, table n2 WHERE n1.id > n2.id AND n1.meta_key = n2.meta_key OR if you want to keep the row with the highest id value: DELETE n1 FROM table n1, table n2 WHERE n1.id < n2.id AND n1.meta_key= n2.meta_key


1

I am not sure where you got that export code but I don't see the PRIMARY KEY defined as it should be. Take a look at the code from Core that creates the table: 87 CREATE TABLE $wpdb->commentmeta ( 88 meta_id bigint(20) unsigned NOT NULL auto_increment, 89 comment_id bigint(20) unsigned NOT NULL default '0', 90 meta_key varchar(255) default ...


0

Are you still facing the issue? I might be able to help you out. Here are some more reasons why it might be happening: A corrupted database – Bad plugins, addons, themes and data-transfer interruptions might leave your database short of tables or completely corrupted at worst. Corrupted WordPress files Found this on: ...


1

Woocommerce stores 'order' metakeys in the table wp_woocommerce_termmeta. The mechanism it uses is the same as menu_order for posts. Check this thread for reference. Thanks


2

It is because of different encrypted algorithm. Sometimes users will override the MD5, which is the default algorithm, and add their own, which might need a little longer length to store the password. Take a look at the Q&A's »What data type to use for hashed password field and what length?«, having detailed information about hashes and their length, ...


0

It should be stored in the wp_usermeta table under the entreprise and os user meta keys. You should consider using prefix on your custom meta keys, to avoid name collison. Example: kerzzy_entreprise kerzzy_os It should show up with: SELECT * FROM `wp_usermeta` WHERE `meta_key` = 'entreprise' in your MySQL administration tool, e.g. PHPMyAdmin. ... ...



Top 50 recent answers are included