So basically the form saves a large serialized array in the database. Now since you have multiple forms, you need to iterate over the result from get_results
, unserialize
the column and then access the city
key.
global $wpdb;
$table_name = $wpdb->prefix.'db7_forms';
$results = $wpdb->get_results( "SELECT form_value FROM $table_name WHERE form_post_id = 6062", OBJECT );
// iterate over results
foreach ($results as $result) {
$data = unserialize($result->form_value);
// now the city is in $data['city']
}
Related Posts:
- How to auto login user again after change user_login
- How to Join two tables from separate databases within WordPress
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- WPDB: how to get the value of a field in a custom database table
- How to generate page content from database the right way?
- phpMyAdmin displays error when importing database
- Transferring working local PHP site to wordpress – with database (MySQL)
- Databases – Submitting data from inputs to database [closed]
- Is it best to avoid using $wpdb for security issues?
- Lost in trying to create user database system
- wordpress site – using custom database and PHP
- add role on WordPress in PHP on a second database
- Front end/Database connection in WP
- direct query to post_meta table
- can’t delete a row from post_meta table
- Can not manually create a database ( db, user, pass ) for a plugin
- Querying multiple meta_keys in WordPress SQL query
- Retrieve data from external database and insert back in
- How to check if image is already stored in a site’s post database? (network)
- How to get the list of WooCommerce product image of a certain category from database?
- Alter query on edit.php
- Changing user_nicename
- WordPress will not operate correctly
- Import 10,000 Users into WordPress WITH a specific ID for each user
- if statement on database query
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- Enhanced WordPress Search
- register_activation_hook isn’t adding table to DB
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Remove query string specific key value
- Preferred Method of debugging a wordpress SQL calls?
- How to get the POST TITLE using the POST ID?
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- WordPress Scheduled Event Request Blocking
- Trying to establish connection to External Database
- How to insert a single row to WP database table?
- Importing Geo data into wordpress database
- $wpdb->update with multiple parameters gives error
- wp search-replace on database returns PHP fatal error: Array and string offset access syntax with curly braces is no longer supported
- Is it possible to create a wordpress database with php code?
- Store a default value for a transient on plugin activation
- Split reads to a different connection string
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- inserting a post from an extern php file but post content doesn’t show on wp site
- Insert custom PHP head above in WP pages
- Not connecting to database in file with multiple MySQL connections
- Building a REST API for your web app exposes primary keys of DB records?
- Saving data from custom form in wordpress database
- wpdb Cannot Update column in Database
- Pull MySQL data from multiple tables and merge into 1 PHP array
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- WPDB – Read and write value from / to database
- How do I make this Metabox show current DB value?
- How to Generate a list of Most Commented post?
- Why when I create a new post I found 2 record related to this post into the posts database table?
- mySQL queries are executed twice on wordpress website
- Remove password protection from all posts
- wordpress sql posts query won’t display the latest post in a specific category
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- $_POST returning empty values
- How to send custom form submissions to WordPress Database?
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- Submiting with problems on one of the options php wprdpress
- Confuse between forms and tables
- code that I can run, or a plug in to show what sql tables something pulls information from
- Adding column to wpex_users
- Using wpdb to connect to a different database is not working
- custom search query database in child theme
- Insert data from form to database
- How to query a staging database?
- Get meta_query value by user meta array
- Where to check in PHPmyAdmin / SQL database for subdomain
- Plugin Modification Change Functionality For Logged User Only
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- I want to use wordpress database in android app using json encode?
- SQL Query Search page
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Can form entries from a WordPress form go to a database
- Conditional statement within WP SQL query
- Weird Behaviour: Not all WordPress Posts appearing
- How to merge 2 WordPress sites?
- two wordpress sites, two themes, one database, same content
- Insert double entry in DB
- Problems with plugin that fetches data from database with ajax
- Check if values exists DB
- MySQL database migration to WordPress
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- MySQL Engine vs. Charset
- Custom query_posts() parameter
- How to check if a value exists in one of two database tables
- How to edit the default database of WordPress [closed]
- notify users when changed database
- Display total count of products in orders of a specific order status
- save array of objects with update_option
- Execute multiple PHP Snippets causes error?
- How to sort search result by post_title, then by post_content
- Can’t insert into a database wordpress