forked from dsilentobsrvr/lexicon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
like.php
92 lines (61 loc) · 1.55 KB
/
like.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<head>
<title>
word lists
</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
div#box1{
position: relative;
top:10%;
left:20%;
min-width:40%;
max-width: 60%;
min-height:90px;
max-height: 140px;
border: 1px solid black;
padding: 10px;
margin:0;
}
.title{
font-size:120%;
}
.lang{
text-transform: uppercase;
margin-left: 70px;
}
.para{
font-size:100%;
font-family: helvetica;
margin-left: 70px;
}
</style>
</head>
<body>
<?php
require_once ('connect_db.php');
///words list
// Make the query:
$sqry=$_POST['keyword'];
$Q = "SELECT * FROM words WHERE word LIKE '$sqry'";
$R = @mysqli_query($dbc, $Q); // Run the query.
// Count the number of returned rows:
$num = mysqli_num_rows($R);
if ($num > 0) { // If it ran OK, display the records.
// Print how many users there are:
/*echo '
<tr><td class="border1" ><b>word_id</b></td><td class="border1"><b>word</b></td><td class="border1"><b>meaning</b></td>
<td class="border1"><b>language</b></td></tr>';*/
// Fetch and print all the records:
while ($row = mysqli_fetch_array($R, MYSQLI_ASSOC)) {
echo '<div id="box1"><span class="title"> <i>' .'('. $row['word_id'] .')<b>'. $row['word'] . '</i></b></span>
<p class="para">' .$row['meang'] . '</p><span class="lang">' . $row['lang'] . '</span></div><br/>';
}
// Close the table.
mysqli_free_result($R); // Free up the resources.
} else { // If no records were returned.
echo '<p class="error">There are currently no words in the database.</p>';
}
?>
</body>
</html>