简体   繁体   中英

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?

You have to use Ajax for that. Get the value of "rowcode" through ajax and then use in the sql query!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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