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

时间:2013-09-02 11:49:54

标签: php javascript sql-server

<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=  ))");

我不知道如何将rowcode的值设置为id?

1 个答案:

答案 0 :(得分:0)

你必须使用Ajax。通过ajax获取“rowcode”的值,然后在sql查询中使用!!

相关问题