如何基于php中的多个下拉选择获取表中的选定值

时间:2019-04-21 07:00:12

标签: php

Sql数据库过滤。从多个下拉列表中进行过滤。一个框在数据库中具有字符值。另一个具有数值。我需要为特定的类提取特定sgpa的sgpa值。
如果我选择单独的课程,那么所有sgpa都可以正常运行。但是,如果我选择的特定sgpa不能正常工作。

$select = mysqli_query($connect,"select * from marks where class='$class' and sgpa =='$sgpa'")or die(mysql_error());


$select = mysqli_query($connect,"select * from marks where 
                class='$class' and sgpa =='$sgpa'")or die(mysql_error());

具有特定sgpa的特定班级

1 个答案:

答案 0 :(得分:0)

首先,mysql没有双等于MySQL Double Equal Sign,因此您应该使用准备好的语句,因为这是非常不安全的。

如果要在spga变量中存储多个值,则需要将其分解并使用mysql # Constants projectDir = meson.current_source_dir() # MESON_SOURCE_ROOT buildDir = meson.current_build_dir() # MESON_BUILD_ROOT lib1Path = join_paths(projectDir, 'Lib') lib2Path = join_paths(projectDir, 'Lib') objCCompiler = meson.get_compiler('c') MyLib1 = objCCompiler.find_library('MyLib1', dirs : lib1Path) MyLib2 = objCCompiler.find_library('MyLib1', dirs : lib1Pat2) 或创建一系列WHERE IN (value 1, value2 ....etc)子句(OR)等。

相关问题