-
Notifications
You must be signed in to change notification settings - Fork 2
/
function.php
37 lines (29 loc) · 964 Bytes
/
function.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Created by PhpStorm.
* User: ft
* Date: 2017/4/26
* Time: 下午12:34
*/
function TrendingProjName($con,$i){
$result = mysqli_query($con, "SELECT ProjName FROM Projects ORDER BY SponsorCount DESC LIMIT ".$i.",1");
return $result;
}
function TrendingProjDescription($con,$i){
$result = mysqli_query($con, "SELECT Description FROM Projects ORDER BY SponsorCount DESC LIMIT ".$i.",1");
return $result;
}
function TrendingProj($con,$i){
$result = mysqli_query($con, "SELECT ProjName, Description FROM Projects ORDER BY SponsorCount DESC LIMIT ".$i.",1");
return $result;
}
function Searchkeywords($con,$keyword){
$result = mysqli_query($con, "SELECT ProjID, ProjName, PostTime FROM Projects WHERE ProjName like ".$keyword." Order by PostTime desc");
return $result;
}
function test_input($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}