Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- error_reporting(E_ALL);
- $host = "xxxxx";
- $user = "xxxxx";
- $pass = "xxxxx";
- $db = "xxxxx";
- $conn = mysqli_connect($host, $user, $pass, $db);
- if(!$conn)
- {
- die("Connection Failed: " . mysqli_connect_error());
- }
- $sql = "SELECT QId, Question FROM Questions";
- $result = mysqli_query($conn, $sql);
- if (mysqli_num_rows($result) > 0)
- {
- // output data of each row
- while($row = mysqli_fetch_assoc($result))
- {
- // THIS WORKS echo "id: " . $row["Question"]. "<br>";
- echo " <label><input type="checkbox" id="Questions" value="$row[QId]"> $row[Question]</label><br>";
- }
- }
- else
- {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement