Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'dominicclustersql.mysql.database.azure.com';
- $username = 'dominic@dominicclustersql';
- $password = 'Dom90madd';
- $db_name = 'clusterresults';
- //Establishes the connection
- $conn = mysqli_init();
- mysqli_real_connect($conn, $host, $username, $password, $db_name, 3306);
- if (mysqli_connect_errno($conn)) {
- die('Failed to connect to MySQL: '.mysqli_connect_error());
- }
- //Run the Select query
- printf("Reading data from table: \n");
- $res = mysqli_query($conn, 'SELECT * FROM wordcount');
- while ($row = mysqli_fetch_assoc($res)) {
- $field1name = $row["word"];
- $field2name = $row["count"];
- echo '<br>'.$field1name." Repeats: ".$field2name." times".'</br>';
- }
- //Close the connection
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement