我想sql
根据从用户那里收到的数据动态创建查询。
代码:
$test = $_POST['clientData']; //It can be an array of values
count($test); //This can be 2 or 3 or any number depending upon the user input at the client
$query = "select * from testTable where testData = ".$test[0]." and testData = ".$test[1]." and . . .[This would vary depending upon the user input]"
是否有可能实现上述场景。我在这方面相对较新。您的指导会有所帮助。