I have a text file file over 10k lines of random names (names.txt), and a Database containing user information (user_info)
The user_info database is structured similar to this:
user_id, name, email, DoB, gender
1, John, email@email.com, 01/01/1990 M
2, Tim, email2@email.com, 01/01/1991 M
And so on..
What I'm basically trying to achieve is a name search using a txt document.
so when you upload the text document if a a name in there is 'Tim' it'll echo all the users called Tim in the user_info database along with their email, Date of Birth and gender.
(I have no Idea how to do this but I'm guessing something like this)
<form action="search.php" method="post" >
<input type="hidden" name = "submit" value="Search" />
</form>
<?php
$namestxt = file("/names.txt");
if (isset($_POST['submit']))
{
$getUsers = mysql_query("SELECT * FROM `user_info` WHERE `name` = '".$namestxt."'");
while ($userInfo = mysql_fetch_assoc($getUsers))
{
echo $userInfo['name'].' . $userInfo['email'] . $userInfo['DoB'] . $userInfo['gender']<br/>';
}
}
?>
I know this code is probably way off, but hopefully you can understand what I am trying to do here.
Any help, thanks.