Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // DB details
- $hostname = "whatever";
- $username = "whatever";
- $password = "whatever";
- $dbname = "whatever";
- // Create connection
- $conn = new mysqli($hostname, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM relevant_topics";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // Removing special characters from rows.
- while($row = $result->fetch_assoc()) {
- $cardID = $row["cardID"];
- echo '<div class="card">"$cardID"</div>';
- }
- }
- else {
- echo 'connection failed';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement