PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- Hint: use Ctrl+Enter for SQL autocomplete CREATE TABLE AuthorInfo ( AuthorName TEXT, Nationality TEXT, Gender TEXT ); INSERT INTO AuthorInfo VALUES('Brits, Mike', 'UK', 'M');
Copy Clear
Copy Format Clear
<?php $conn = $mysqli; $sql = "SELECT * FROM `AuthorInfo` WHERE `AuthorName` LIKE '%$author%'"; $result = mysqli_query($conn, $sql); $queryResults = mysqli_num_rows($result); if ($queryResults > 0) { while ($row = mysqli_fetch_assoc($result)) { echo "<div class='article-box'> <p>Author Name: " .$row['AuthorName']."</p> <p>Nationality: " .$row['Nationality']."</p> <p>Gender: " .$row['Gender']."</p> </div>"; } }
Show:  
Copy Clear