/ Published in: MySQL
$connect = mysql_connect("localhost:8889", "root", "root");
This means you need your host, user, pass
Expand |
Embed | Plain Text
<?php $connect = mysql_connect("localhost:8889", "root", "root"); if(!$connect){ die("Failed to connect: " . mysql_error()); } if(!mysql_select_db("ourDatavase")){ die("Failed to select DB:" . mysql_error()); } $results = mysql_query("Select * FROM someData"); if(!$results){ die("Failed to run query:" . mysql_error()); } while($row = mysql_fetch_array($results)){ echo $row['name'] . "<br/>"; } ?>
You need to login to post a comment.
