Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

my php database search script

Featured Replies

Ok well i've made this simple search you may use to search a database and display results

 

 

Search.php

<?php
mysql_connect(localhost,root,"") or die ("can't connect to database");
mysql_select_db(test);

$find = $_POST['search'];

if(isset($_POST['submit'])){
if($find == ""){
echo"<b>No Search Term Entered</b>";

}else{
$sql = "SELECT * FROM table_name WHERE Fname LIKE '%$find%' OR Lname LIKE '%$find%' OR email LIKE '%$find%'";
$sql2 = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($sql2) == 0){
echo"<b>No Results Found</b>";

}else{
while($results = mysql_fetch_assoc($sql2)){

$fname = stripslashes($results['Fname']);
$lname = stripslashes($results['Lname']);
$email = stripslashes($results['email']);

echo"".$fname."<br /> ".$lname." <br /> ".$email."";
}
}



}

echo "
<form method=\"POST\" action=\"$_SERVER["PHP_SELF"]\">
<p>
<input type=\"text\" value=\"Keyword\" name=\"search\" title=\"Search\" onclick=\"if(value='Keyword'){value=''}\"><br />

<input type=\"submit\" name=\"submit\" value=\"Search\">
</p>
</form>
";

?>

 

And that should do the trick i have not tested it yet so if you catch a mistake above let me know and i'll fix it now just create the database and the tables then you have a simple search you can build off of. you can select from as many tables you like and search everything inside your database enjoy:clapping:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.