duanhe1965 2018-06-11 18:32
浏览 26

传递Jquery文本参数在我的php mysql数据库中不起作用

trying to call my MSQL database using a movie title to get plot info. I tested that the movie title does pass correctly to my function using alert statement, so that worked well. The problem is when I try to pass the title to my php/mysql it shows me the title did pass when I use echo $q1 in my php, but I get blank info from my data base. However if I force set a title $q1="127 Hours" in my php file , everything works. so it's a bit confusing to me.

function getmoviepic_mobile(movietitle){
var Movie = $(movietitle).text();
alert(Movie);
$('#dvdinfo').load('getuser2_mobile.php', {input:Movie});
}

PHP File..

include("includes/connection.php");

$q1=$_POST['input'];

echo $q1;


//$q1="127 Hours";

$result = mysql_query("SELECT 
id,title,actors,plot,catagory,release_date,rated FROM ".TBL_DATA." WHERE 
title = '".$q1."' ");

while($row = mysql_fetch_array($result)) {


echo "<div <p> ".$row['title']." <p> </div>";


echo "<div <p>".$row['plot']." <p> </div>";

 }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记