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
- Advanced Custom Fields in WP_Query: Href Returning Empty
- Point homepage to custom php page
- When to use WordPress loop or Foreach loop?
- Simplify the admin end
- If custom image header does not exist display text header
- how to json_encode(); the Loop content so that the encoded array is [“0”:content, “1”:content]
- WordPress Query Posts From Category Post on Static Page
- If the image variable is specified, show image, if not no code
- Best Practice for Displaying Categorized Posts on Front Page
- Displaying multiple post types on home page
- Garbage in uploads folder
- What is theme-editor.tmp?
- WordPress noob, assign custom stylesheet using @import or if? Didn’t work for me
- Restrict Viewing of post on both front and backend?
- I want to print a message in post ” After one month from publish date”
- What happens to the mu-plugins folder when you upgrade to WordPress 3?
- Use custom header as WordPress header
- How to change the “All Categories” label within the panel of my custom post type?
- Get wordpress taxonomy slug name(s) to use as div class
- How to query details of images in gallery that is attached to a post
- Is it necessary to use Timthumb in WordPress 2.9+?
- inserting uploads into subdomain
- More tag – how do I remove preceding ?
- Why does my Posts page only show a single post when using Thematic?
- How to show wp.me shortlink underneath each post?
- digital alarm clock widget
- Target pages using a specific page template
- Salesforce lead tracking with contact forms plugins [closed]
- Specific colours for wordpress author ids
- In WordPress 3.x, I can’t access posts from all blogs in the network
- WordPress Install Issue, Receive Warnings But Successful Install
- I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
- str_replace inside specific css files [closed]
- Shop page custom buttons which is visible to only administrator
- Applying WP-cli Search & Replace to Static SQL Dump File
- How to print Array values of custom Fields Meta?
- Change Successful password reset message
- Undefined variable: user_id in get_user_meta
- Is it possible to make wordpress LMS
- White letters in header
- Saving contact form 7 data into custom Table
- Get users based on month ACF datepicker field
- Creating a shortcode by pulling in a custom field from a plugin
- Divi: how to hide/show specific menu according current page?
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- “woocommerce_form_field()” function having issues after latest woocommerce update [closed]
- What is the best way to modify Admin Panel on WordPress?
- How do you add a table to a site?
- add custom content to appearance/widgets screen
- buddypress remove username from autocomplete
- I tried to change my URL and ended up losing access to my site? I went into general settings and changed both WordPress URL and Site URL
- Is there another way to customize a parent template file besides adding the file to a child theme?
- Show title bar only on archives / hide it on all posts and pages
- How to customize shipping region/states on WooCommerce
- How do I modify the size of the text in my page titles?
- how to make a custom field readonly or disabled by user role?
- How to make wordpress use a non-wordpress users table?