I m creating a user based website in Wordpress, where each users can create an account and upload data of their records into the website. But I m having trouble thinking of how users can view a database table that presents relevant data to the user. Its a golf website where the user can lodge in their exercises, what equipment they used and when they exercised. I m trying to query from my database table for data specific to a …
I love ACF, its great for developers and it seems to have so much support. BUT... Why is reset_rows() not in the documentation? I created a function that can delete repeater rows at different times in the code. I was using the rows loop each time expecting it to start at index 0 (or 1 in acf's crazy way). But each loop started where the previous one left off. This gave me grief for quite a while. I have only …
I am currently trying to create a drop down feature with the repeater custom field input. This may or may not be the right custom field to be used but it seems like it is given the other offered options. So, this is what my custom field looks like on the admin panel: It is very simple what I am trying to do. I am trying to display the first three options of this list. I then want to add …
Is this the right way to use get_row with a select *? $_crds = $wpdb->get_row($wpdb->prepare(" SELECT * FROM `mailers` WHERE `id` = %d", $_GET['caId'] )); $_zipcodes = $_crds->zipcodes; $_maildate = $_crds->maildate; Is that the right way to pull the values from the database? I have a lot of records in that table I need to pull, so wanted to do it in one db pull... but my code appears to not be working. -Rich
I have a query where I get the highest id from a table. $user_id = $wpdb->get_row("SELECT * FROM $table WHERE id=(SELECT MAX(id) FROM $table)") The table should always have rows, but if for some reason it returns empty, there is an error (printed with $wpdb->print_error()): WordPress database error: [] I was wondering why an empty result means an error? And how would I prevent this error?
I am trying to run the following query to access my WP cf7dbplugin_submits table but it keeps coming up empty. I have added my table into wp-db.php model as such: Added the contact form table- cf7dbplugin_submits to the following at about line 268: var $tables = array('cf7dbplugin_submits','posts', . . .) At around line 304 add the following: /** * WordPress cf7dbplugin_submits table */ public $cf7dbplugin_submits; So the database function should find it (it has when used elsewhere in my code). …
This is my query to check if a title exists (it's in a loop, therefore [$i]). $wpdb->get_row("SELECT * FROM wp_posts WHERE post_title = '" . $titles_arr[$i] . "'", 'ARRAY_A'); Anyway, I would like to know how to use LIMIT 0,1000 to query only the last 1000 added posts to the database when using get_row() function. Any idea?
I am trying to match a posts meta_key value to a separate tables column ID and call that row/array in the single-listing.php. I have a meta_key value that is called dot_number. The table is called wp_csadata and has a column called dot_number. Lets say the meta_key equals 12. I need to call that wp_csadata table and match the meta_key value of 12 to the column called dot_number, which has the same number, and return values in the row. Thanks.
On index.php page, I am showing only thumbs and two custom fields. How can I set specific number of posts in one row like this one; http://www.whatmobile.com.pk
I'm using switch_to_blog() and restore_current_blog() to perform some functions across a multi site install. One of the things I'm trying to do is select a very specific post using get_row(). My function looks like this: $prefix = $wpdb->prefix; $tbl = $prefix; $product = $wpdb->get_row("SELECT * FROM {$tbl}_posts WHERE ID = 4253"); print_r($product); exit; The post with ID 4253 definitely exists, and I know for sure that the prefix is correct, however print_r returns absolutely nothing, nor does echo $product->post_title; Any …