Hi all,
I’m in the process of coding a book browser with a database backend via phpMyAdmin. Right now the search function takes the user input and prints out all the relevant book titles (with author and genre) in one column down the center of the page. But that’s not really making good use of the white space on the page in my opinion. Is there a way to alter the code so that the data is displayed in 3 columns instead of just one? Below is my current code:
[php]
$query_string = $query_string.“CONCAT(TITLE
,AUTHOR
,GENRE
) LIKE '%”.$predicate_word."%’";
}
$query = mysqli_query($con, $query_string);
$num_rows = mysqli_num_rows($query);
?>
<p><strong><?php echo $num_rows; ?></strong> results for '<?php echo $q; ?>'</p>
<?php
while(isset($q) && ($row = mysqli_fetch_array($query))) {
$title = $row['TITLE'];
$author = $row['AUTHOR'];
$genre = $row['GENRE'];
echo '<h3><a href="text.php?url=' . $row['URL'] . '">' . $title . '</h3></a><p> by ' . $author . '. ' . $genre . '. </p><br />';
}
}
?>
[/php]
Any help is appreciated. Thanks!
- tristanwang99