/
nameDB.php
47 lines (41 loc) · 1.04 KB
/
nameDB.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
37
38
39
40
41
42
43
44
45
46
47
<?php
include 'configure.php';
include 'connect.php';
include 'dbFunc.php';
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
echo '<response>';
if (isset($_GET['NameInput'])){
$userInput = $_GET['NameInput'];
}
// choose then pull down the database you want.
$pull = "t4"; dbPull($pull);
// select everything from the database table.
$dbItems = Qquery("SELECT * FROM `picks`");
// spread out the table from the db
// $ARay = QfetchArray($dbItems);
$daata = array();
while ($ARay = QfetchArray($dbItems)) {
array_push($daata, $ARay['Name']);
}
/*/ while ($row = $Array) {
$da= explode('-', $row['date']);
$daa= $da[1]."-".$da[2]."-".$da[0];
echo '
<tr>
<td>'.$daa.'</td>
<td>'.$row['usir'].'</td>
<td style="width: 300px">'.$row['msg'].'</td>
</tr>
';
}
*/
if(in_array($userInput,$daata)){
echo 'We\'ve found: '.$userInput;
}elseif ($userInput=='') {
echo 'Awaiting input.';
}else{
echo 'Nothing available by that Name';
}
echo '</response>';
?>