okay, my problem is simple. i'm trying to code a simple search of a database called "users". i can connect just fine but when the code gets to the select statement, it seems to run into a wall. i can't figure out what's going on and was hoping someone could give me a hint.
Code: Select all
<?php
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$dbc = mysqli_connect('OMITTED', 'a5753424_test', 'OMITTED','a5753424_test')
or die('error connecting to db');
$query = "SELECT * FROM users WHERE first_name LIKE %$first_name% OR last_name LIKE %$last_name%";
$result = mysqli_query($dbc, $query)
or die('error querying db');
while($row = mysql_fetch_array($result)){
$search_first = $row['first_name'];
$search_last = $row['last_name'];
echo '$search_first' . '$search_last'. "<br>";
}
mysqli_close($dbc);
?>