如何设置PHP变量以获得jQuery变量的值? [英] How do I set a PHP variable to have the value of a jQuery variable?
本文介绍了如何设置PHP变量以获得jQuery变量的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下问题:
我有一张订单表。每行都有一个编辑按钮。当我点击它时,会打开一个弹出窗口并加载订单进行修改。问题是我无法将正确的值传递给php中的SELECT查询。
function fnOpenNormalDialogEdit(jQueryParam){
<?php
$ phpVar = ' 具有jQueryParam'的值;
$ OrderEdit = $ wpdb-> get_row($ wpdb-> prepare( SELECT * FROM $ EWD_OTP_orders_table_name WHERE Order_ID ='%d',$ phpVar));
.....
}
如果我传递
$ phpVar = 19 ;
例如,正确的订单已加载,一切正常。但我找不到设置真正价值的方法....
$ phpVar = ' 具有jQueryParam'的值;
我不想重新加载页面,我尝试了ajax但是无法做到。请帮助
谢谢,
Didi
解决方案
phpVar = ' 具有jQueryParam'的值;
OrderEdit =
wpdb-> get_row(
I've got the following issue:
I've got a table with orders. On each row there is an Edit button. When I click it a popup opens and the order is loaded to be modified. The problem is that I cannot pass the right value to the SELECT query in php.
function fnOpenNormalDialogEdit(jQueryParam) {
<?php
$phpVar = 'to have the value of jQueryParam';
$OrderEdit = $wpdb->get_row($wpdb->prepare("SELECT * FROM $EWD_OTP_orders_table_name WHERE Order_ID='%d'", $phpVar));
.....
}
If I pass
$phpVar = 19;
for example, the right order is loaded and everything is ok. But I cannot find a way to set that real value....
$phpVar = 'to have the value of jQueryParam';
I don't want to reload the page, I tried ajax but couldn't do it. Please help
Thanks,
Didi
解决方案
phpVar = 'to have the value of jQueryParam';
OrderEdit =
wpdb->get_row(
这篇关于如何设置PHP变量以获得jQuery变量的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文