douchuilai2355 2014-01-09 06:38
浏览 49

图书馆管理的搜索功能

I am new to php or i can i m very new to coding . i have given with project library management by my company . i want to add the feature search in my project ..
There are two searches in my project
1- student search- this feature will search the student n will display all the details about that particular student . search should be done on the category basis. like if i want to search a student on the basis of class, or may on the basis of branch , name .so first i need to select the category on what basis i want to search and then will type what i want to search. n hence the result should get displayed
2- book search- this feature will search the books we have in our database and will display all the details of the particular book but here as i m having category of the book .. engineering(even i engineering i have category - computer science , mechanical , electrical ) , friction book , stories book so i need a search category wise here.. can anybody please help me out in this to make a best search ...! will b pleased..

  • 写回答

1条回答 默认 最新

  • douzhaishan5462 2014-01-20 10:48
    关注

    ?php include 'start.php'; //This is only displayed if they have submitted the form if (isset($_REQUEST['searching'==yes])) { echo "

    Results

    "; $field=$_REQUEST['field']; $find =$_REQUEST['find']; $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $u= "SELECT * FROM student WHERE upper($field) LIKE '%$find%' "; $v= "mysqli_query($con,$u)"; while($result = mysql_fetch_array( $v )) { echo $result['student_id']; echo " "; echo $result['name']; echo "
    "; echo $result['class']; echo "
    "; echo $result['branch']; echo "
    "; echo "
    "; } $anymatches="mysqli_num_rows($v)"; if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query

    "; } else {//And we remind them what they searched for echo "Searched For: " .$find; } if (empty($_REQUEST['find']) ) { echo "

    You forgot to enter a search term"; die; } } ?>

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!