Questions tagged [get-row]

The tag has no usage guidance.

0
votes
1answer
174 views

Handling repeater data

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 ...
0
votes
2answers
931 views

wpdb get_row database query inquiry

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; $...
0
votes
1answer
971 views

Why is an empty result an error? ( $wpdb->get_row )

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 ...
0
votes
2answers
1k views

get_row returns empty when data exists

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- ...
0
votes
1answer
573 views

Best practice to limit results in get_row()?

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 ...
1
vote
1answer
95 views

Get a row from a separate table by matching a posts meta_key to a tables ID column

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 ...
0
votes
2answers
1k views

Show post thumbs in rows instead of columns

I am displaying only thumbs and title on index pages using following code; <div id="column1"> <?php query_posts('cat=22&showposts=2'); ?> <?php $posts = get_posts('cat=22&...
-3
votes
1answer
2k views

Display posts in row Horizontally [closed]

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
0
votes
1answer
178 views

Trouble with SQL SELECT inside switch_to_blog()

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 ...