So in this case, the problem is that your line right before the echo
call is incomplete:
$number_rows= $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->daviddgl_wp1.SaveContactForm7_7" );
$x=1;
while ($x<$number_rows) {
$results = $wpdb->get_results("SELECT ticket, name,email FROM $wpdb->daviddgl_wp1.SaveContactForm7_7 WHERE id = $x");
print_r($results);
$x++;
}
(You’re missing the closing bracket and semi-column)
Note also that your echo will not work here, since $results will be an array. You’ll probably want to use var_dump or print_r – like I did in the above example.
Hope this helps!
Related Posts:
- How to return number of found rows from SELECT query
- How do I make an HTML table from a database table?
- $wpdb->delete column values IN ARRAY()?
- WPDB: how to get the value of a field in a custom database table
- if statement on database query
- Why is variable not working on custom sql query using wpdb?
- How to get the POST TITLE using the POST ID?
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Transferring working local PHP site to wordpress – with database (MySQL)
- Trying to establish connection to External Database
- Create WP_Query to search for posts by their categories or their parent/child categories
- Getting id of poll from WP database
- How to insert a single row to WP database table?
- $wpdb->update with multiple parameters gives error
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- inserting a post from an extern php file but post content doesn’t show on wp site
- Fatal error: Call to a member function query() on a non-object
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Delete database record using plugin from admin panel
- Wpdb get->results to out the the month from the db
- Creating custom page template from existing PHP site
- wordpress site – using custom database and PHP
- WPDB – Read and write value from / to database
- How to Generate a list of Most Commented post?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- WordPress SQL JOIN query
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Add posts to custom table in database instead of wp_posts
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Passing in MySQL prepare statement parameter separately throwing error
- Using wpdb to connect to a different database is not working
- Modify post image in full size
- How to grab data from input and store it into custom table in database?
- How to return count of items found in SQL query
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- direct query to post_meta table
- WooCommerce – Print Processing orders [closed]
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Weird Behaviour: Not all WordPress Posts appearing
- How to fetch results from database
- Querying multiple meta_keys in WordPress SQL query
- MySQL database migration to WordPress
- Custom query_posts() parameter
- Fetching wpdb data from a php file seems to break?
- Insert into db with foreach problem
- Changing regular db connection to $wpdb
- Execute multiple PHP Snippets causes error?
- How to get data (not value or name) from radio options to POST to database
- Putting form result in my database
- Custom query to get post names beginning with a digit
- Blank on static home page?
- How to use a frontend URL with a Plugin
- How to display a value from a radio button in the options menu in wordpress
- Custom image upload
- How to display recent posts on home page with custom HTML
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Upload Image in a WordPress page using PHP
- SQL QUERY – Select a value directly from the database
- I want to select the from values from database in WordPress? [closed]
- Why the JavaScript code is ignored from wp editor?
- How does WordPress know wich language is chosen when there is a database connection error
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Why Won’t My Inputs in a form with a Get method work together?
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- How to get the value of input hidden html from text editor to custom page template?
- Get posts from multiple post type
- How to convert select to HTML with PHP tags inside of it [closed]
- How to add div blocks after certain set of post
- Specify strict ‘order by’ in WordPress query
- Does WordPress have something like Drupal’s DB API?
- Most commented posts by time period (last 12h, last 24h and etc)
- Hide posts if user is added to it WP_query
- Set default Database Storage Engine when creating tables with plugins?
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- Modify main query before it run without pre_get_post
- Change MySQL PDO connection to a WPDB connection
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- Replace a single variable with add_filter
- WordPress SQL Prepare
- WP Website is shown in HTML
- wp_update_post gives 500 internal error
- What is the correct way to search 3 custom fields only in WordPress?
- get_filtered_term_product_counts – Get product terms if any products
- How to Protect a private folder inside uploads folder, if User is not Logged In?
- List all ACF field values across every post on one page
- Multisite – Display different header content based on which site is accessed
- Querying posts from wordpress with 2 or more conditionals
- html to posts, jpg to featured image, zip file contains jpg and html
- Display Year and Month from custom field + Age Calculator
- Manipulate database of WordPress site with my own scripts
- How Can I Center the Logo in the Navigation Menu? [closed]
- How to pass username into form that sends data to database
- a problem in class in class-wp-hook.php