Your code is selecting from the database where cor_estado.estado_id
equals $Estado_id = $_POST["selectVal"];
, but in your JavaScript you’re not sending an ID as $_POST["selectVal"]
, you’re literally sending the text string "selectVal"
:
data:{action:'my_action', selectVal: 'selectVal'},
Change that to this, to send the actual variable value:
data:{action:'my_action', selectVal: selectVal},
Related Posts:
- how to override woocommerce specific loop or archive-product.php [closed]
- When adding a custom REST endpoint, where do you put the endpoint function, and where do you put the function registration call?
- How can I create an alternative home page?
- Getting $comments outside the comment template
- How wp_ajax_nopriv since WordPress 3.1
- Multiple Queries and Excluding Repeating Posts?
- Last post is not showing up
- get_option issues
- How to use get_option() without any filter?
- Show post page only if the user has bought a specific product
- Custom Login and Registration form in Ajax
- Adding Pagination on a Custom Author Page
- Exclude custom taxonomy tag from loop
- Calling a php file from a javascript file in wordpress
- Loop through custom fields with similar label / common chars in label
- Load more posts with multiple queries
- Pagination Issues using WP_Paginate Plugin
- CPT Loop with ACF and passing ID between Loops
- Viewing checkout page removes fees from mini cart
- Load MediaPlayerElement after Infinity Scroll loads more posts
- WordPress : using AJAX to get posts & Sidebar Content to an external application
- toggle Multiple Loop with tittle
- Exclude current post but keep the same posts-per_page amount
- wordpress custom fields loop
- WordPress next post by ajax call on button click
- mailchimp integration on a custom footer
- How to show related post with category DESC (ASC) IDs of ID current post
- Avoid showing the same phrase in the loops
- Multiple loops on same category with different design
- Custom query pagination with php parameter as arg problem
- POST 429 Error when trying to place more than 20 images into post at once
- My post loop needs to have 8 different post templates
- How to submit form data in the same page in WordPress without reloading the page?
- Multisite – Getting Meta query to select from wp_2 tables
- How to append the excerpt to the content in the single post page?
- Multiple Owl Carousels on the same page with navigation problem
- Pull A Single Post Prior To Running wp_query
- Highlight specific user with custom field value
- custom loop issue
- Secondary loop doesn’t work
- Unable to show messages using ‘admin_notices’
- Post thats in Two Categories, only want to display name for one
- Loop display only 5 posts
- Backup the Database and Restore from the Backup?
- Scaling a WP eCommerce site
- Looking for a lightweight theme using WP3 new tags and features (not 2010) [closed]
- Limit Media Library to Given Folder
- How can I get posts in a subcategory to display on it’s parent categories archive page?
- customize_register with Multiple controls/settings – how to get values?
- How do I prevent one of two multiple loops from repeating on a second page?
- Integrating the WordPress admin panel with a frontend theme
- simple wp_insert_post example
- Redirect members to custom page upon logging in through WP admin
- WP_Query with the “offset” argument
- Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
- Auto add taxonomy if post has category
- How to add classes in the wp_list_category parent link
- Name/Word Replacement Plugin
- Get page ID outside the loop, matching menu ID
- help to change some colors (woocomerce and store locator) [closed]
- Show Featured Post Only On The Homepage
- Custom wp-content and upload directory
- Lost password empty field error redirect to custom login
- Custom comments list, right depth
- WordPress Custom File Permalink
- WordPress 3.0.1 on IIS 6 Web Server PermaLink Issues
- how to display a specific wordpress menu?
- Change Notice of Password change email subject?
- Deleting my old WordPress site. – issues
- Remove year from title
- Custom Tags Archive – permalinks not working
- How to append custom text to the output of ‘categories widget’?
- How to assign a custom post title to be the post ID?
- Change Site Logo or Menu Logo Per Page
- How do I query based on the modified date?
- WP Search Form Query: Add Author’s posts into search query
- Creating a “Delete”-Button for Metadata userspecific
- Change default Video Player without Plugin
- export and import wordpress customization
- where is admin footer?
- How can i add customisation of text to my theme?
- Can I overwrite custom taxonomy FROM “public” TO “false”
- Trying to customise 2011 Child Theme Background Colour
- New Page/Post Screen Opens an Existing Post
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Custom product status get filtered on all product list views
- URL issue after setting up Custom Structure in Settings >> Permalinks
- Can I upload my self hosted WordPress website on GitHub as a project? [closed]
- Create single{custom}.php with data in table out of wp_posts
- How do i edit text that is not in the customization menu
- How do I map two domains to the same wordpress installation?
- Where should I put this custom data?
- Changing starting number of User ID
- how to register / add multiple options into one field in wordpress?
- How to duplicate “Pages” section in the control panel?
- WordPress Customize panel – accessing the values
- Show post content in two different places without redirect
- Multiple Customizers
- User Query Multiple Orderby Clause
- Create a page for each database table entries