Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hostname = 'hostname';
- $dbname = 'dbname';
- $username = 'username';
- $password = 'password';
- $con=mysql_connect($hostname,$username,$password,$dbname) or die("Failed to connect to MySQL: " . mysql_error());
- $db=mysql_select_db($dbname,$con) or die("Failed to connect to MySQL: " . mysql_error());
- $query = "SELECT * FROM `Treatments`";
- $result = mysql_query($query, $con);
- $options = "";
- if (!$result){
- die("No results found.");
- }
- while ($row = mysql_fetch_array($result)){
- $options .= "<option>$row[1]</option>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement