I can't get the following code to display items from the database where the parent_id is equal to the id.
Here is the code below.
// Query member data from the database and ready it for display
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT * FROM categories WHERE id=parent_id");
if (!$dbc) {
// There was an error...do something about it here...
print mysqli_error();
}
while ($row = mysqli_fetch_assoc($dbc)) {
echo '<li><a href="' , $row['url'] , '" title="' , $row['description'] , '">' , $row['category_name'] , '</a>';
}
I think I know what I'm doing wrong how can I have this query check a previous query?