Select record from form and update
-
I presently retrieve a record by inputting the LastName of the member.
<form id = 1 action = "https://hsysgrp.com/wp-content/themes/twentytwelve-child/custom-page_Members_Desc.php" method="POST"> <input type ="text" name = "search" placeholder= "Search for Members..."/> <input type = "submit" value = "search" /> </form> if(isset($_POST['search'])) { $searchq = $_POST['search']; echo "<br>$searchq<br>"; $searchq = preg_replace("#[^0-9a-z]#i","",$searchq); $query = mysqli_query($link,"SELECT ID, FirstName, LastName FROM AAUW_Members WHERE FirstName LIKE '%$searchq%' OR Lastname LIKE '%$searchq%'") OR die("Could not search!"); $count = mysqli_num_rows($query); if($count == 1) { echo "<br>Before while...<br>"; $row = mysqli_fetch_array($query); $FirstName = $row['FirstName']; $LastName = $row['LastName'] ; $ID = $row['ID']; $output .= '<div>'.$ID.' ' .$FirstName.' '.$LastName.'</div>'; echo "$output";
This works fine, however I have a number of Smiths in the database, and have been unsuccessful in doing a search on FirstName and LastName.
<form action = "https://hsysgrp.com/wp-content/themes/twentytwelve-child/twentytwelve-child/custom-page_Members_Desc.php" method="POST"> <input type ="text" name = "FirstName" placeholder= "Search for First Name..."/> <input type ="text" name = "LastName" placeholder= "Search for Last Name..."/> <input type = "submit" value = "search" /> </form>
How do I pass the FirstName value?
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Select record from form and update’ is closed to new replies.