Can I have a member search a mysql database that lists members, titles (writers - directors ) and email addresses for whichever catagory they want..ie search for writers and only have the writers results with their email addresses returned to an html Page?? I end up getting everyone listed..
this is my html page..
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body>
<form action=searchform2.php method=GET>
Search For:
<p>
Title: <input type=text name=Title size=25 maxlength=25>
<p>
First Name: <input type=text name=FirstName size=25 maxlength=25>
<p>
Last Name: <input type=text name=LastName size=25 maxlength=25>
<p>
EmailName: <input type=text name=EmailName size=25 maxlength=25>
<p>
<input type=submit>
</form>
</body>
this is my php page ..
<body>
<?php
mysql_connect (localhost, root, ++++++);
mysql_select_db (mydatbase);
if ($Title == "")
{$Title = '%';}
if ($LastName == "")
{$LastName= '%';}
if ($FirstName == "")
{$FirstName = '%';}
if ($EmailName == "")
{$EmailName= '%';}
$result = mysql_query ("SELECT * FROM +++++++++
WHERE Title LIKE '$Title%'
AND LastName LIKE '$LastName%'
AND FirstName LIKE '$FirstName%'
AND EmailName LIKE '$EmailName'
");
if ($row = mysql_fetch_array($result)) {
do {
?>
<tr>
<td bgcolor="#999999"><?php print $row["Title"] ?><br></td>
<td bgcolor="#CCCCCC"><?php print $row["LastName"] ?><br></td>
<td bgcolor="#999999"><?php print $row["FirstName"] ?></td>
<td bgcolor="#CCCCCC"><?php print $row["EmailName"] ?></td>
</tr>
<?
print ("");
} while($row = mysql_fetch_array($result));
} else {print "Didn't Work<br><br> -Ron-!";}
?>
</table>
</body>