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
- How to show correct td of table tags in wp_query loop
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- Custom image upload
- How to display recent posts on home page with custom HTML
- Different database query in function.php using mysqli
- WordPress automatically adds tags when pasting code, how to stop it?
- Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function
- Sorting Posts | Alphabetical Order
- Get taxonomy terms only of the WP_Query current posts
- How to generate page content from database the right way?
- Placing raw HTML inside a WordPress shortcode
- How to only show page id as body class?
- How to get to a specific position in wp_query?
- Get category name from custom loop and echo it once
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Add custom php database code above
- Looking for most performant way to execute several similar WP queries within shortcodes
- API response to be stored locally
- Slide in Panel WordPress Post
- wp_insert_post not working
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Order by custom table and multiplication
- Shortcode content output but not in correct place
- Ajax $wpdb not returning table data
- Use wp_get_recent_posts with search term
- Converting MYSQL to WordPress $WPDB
- WP_Query loop, does not display special characters in title correctly
- Remove query string specific key value
- Correct syntax to html php conversion
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Hide post if matches current month and year
- Store and Work with huge array in WP [closed]
- Upload Image in a WordPress page using PHP
- Show post in slider
- Get the last month with posts using a recursive function…
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Use WP_Query in shortcode
- wpdb custom post_type problem
- phpMyAdmin displays error when importing database
- have_posts() execution failure
- Removing unneccessary p-tags (Not every p)
- Prevent Data Resubmission On Page refresh
- How can I hide Home in my menu in a specific page?
- WordPress automatically adding html tag around PHP code