adzie Posted October 6, 2007 Share Posted October 6, 2007 i'm trying to get a search result to create a link to a new form can anyone suggest solution echo $result['name']; is the result Quote Link to comment https://forums.phpfreaks.com/topic/72129-search-result-to-link/ Share on other sites More sharing options...
pocobueno1388 Posted October 6, 2007 Share Posted October 6, 2007 Your going to have to post more code than that. Quote Link to comment https://forums.phpfreaks.com/topic/72129-search-result-to-link/#findComment-363615 Share on other sites More sharing options...
adzie Posted October 6, 2007 Author Share Posted October 6, 2007 sorry thought i'd posted it all here goes <h2>Search</h2> <form name="search" method="post" action="<?=$PHP_SELF?>"> Seach for: <input type="text" name="find" /> in <Select NAME="field"> <Option VALUE="name">Name</option> <Option VALUE="email">Email</option> </Select> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /> </form> <? { echo "<b>Searched For:</b> " .$find; } if ($searching =="yes") { echo "<h2>Results</h2><p>"; if ($find == "") { echo "<p>You forgot to enter a search term"; exit; } include("connectdb.php"); $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'"); while($result = mysql_fetch_array( $data )) { echo $result['name']; echo " "; echo $result['email']; echo "<br>"; echo "<br>"; } $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/72129-search-result-to-link/#findComment-363618 Share on other sites More sharing options...
adzie Posted October 7, 2007 Author Share Posted October 7, 2007 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/72129-search-result-to-link/#findComment-364089 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.