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},