简体   繁体   English

如何在MSSQL查询中使用JavaScript变量

[英]How can use JavaScript variable in mssql query

<script language="javascript">
   var rowcode=0;
   function myclick(id)
   {
     if (rowcode!=0){
        document.getElementById(rowcode).style.background="";
        rowcode=id;
        document.getElementById(id).style.background="yellow";
        }
   }
</script>     

<a onClick="ShowDiv('<?php $result=Select("select * from CourseTeacher where lessonID IN(select lessonID from Lesson where place IN(select place from Place where id=  ))");

I dont know how can set the value of rowcode to id? 我不知道如何将rowcode的值设置为id?

You have to use Ajax for that. 您必须为此使用Ajax。 Get the value of "rowcode" through ajax and then use in the sql query!! 通过ajax获取“ rowcode”的值,然后在sql查询中使用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM