This seems like it should be so easy but I am not getting an error or any result:
$connection = mysql_connect("phpexamplesite.db.4211592.hostedresource.com", "username", "password");
if(!$connection) {
die("Database connection failed: " . mysql_error());
}
//2. Select a database to use
$db_select = mysql_select_db("username", $connection);
if(!$db_select){
die("Database selection failed: " . mysql_error());
Any ideas?
THanks:)
sorry about that… I did put the query in:
// 3. Perform database query
$result = mysql_query("SELECT * FROM subjects", $connection);
if(!$result){
die("Database query failed: " . mysql_error());
}
//4. Use returned data
while($row = mysql_fetch_array($result)) {
echo $row["menu_name"]. " ".$row["position"]. "<br />";
}
?>
<?php
//5. Close connection
mysql_close($connection);
?>
I’m not getting any error or results on the page…
You probably just don’t have any result from the select statement.