liタグをクリックしたとき、クリックした箇所のidをjsの変数に格納しphpの
$command = new MongoDB\Driver\Query(['id' => 1 ]);ここの行を
$command = new MongoDB\Driver\Query(['id' => jsの変数 ]);
といったようにしたいのですが何か方法はありませんか?
index.php
1 <script> 2 $('.list li').click(function(){ 3 var data = $(this).attr('id'); 4}); 5 </script> 6 7<?php 8$command = new MongoDB\Driver\Query(['id' => 1 ]); 9$cursor = $mng->executeQuery("db.list",$command); 10foreach($cursor as $i){ 11 echo $i->id; 12} 13
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/08/15 14:29
2020/08/15 14:47
2020/08/15 21:56
2020/08/16 05:45
2020/08/16 05:56
2020/08/16 06:11
2020/08/16 06:40
2020/08/16 07:02