Ok I am a newb as you can see, I created the DB and created the edit script. THat is complete and fine... but I am trying to get my index.php script to show what I put into the MYSQL DB..
I get this
No Database Selected
SELECT * FROM news
now this is from index.php I ran the DB.php script and get no errors...
Basically it says I have no db selected... yet I know I do cuz I have it selected in db.php....
Now I read the rules so Ill try to show as LITTLE CODING AS POSSIBLE 😃
in db.php this is what I have....
<?php
define("DBSERVER", "localhost");
define("DBUSER", "un_cms");
define("DBPASS", "cms");
$SQL = "";
$LastError = "";
function DatabaseConnect()
{
global $LastError;
$LastError = "";
//-----------------------------
// Connect to the mysql server.
//-----------------------------
$dbHandle = @mysql_connect(DBSERVER, DBUSER, DBPASS);
if ($dbHandle == false) {
$LastError = "Unable to connect to the database server: " . mysql_error();
return false;
}
mysql_select_db("un_cms");
return true;
}
?>
As you can see I have the db selected........
In index.php this is what I have...
include ('db.php');
// Get all the data from the "news" table//
$sql = "SELECT * FROM news";
$result = mysql_query($sql) or die(mysql_error() . '<br>' . $sql);
So I dont know what the problem is... but how do I get rid of that DB not selected error... Ive been trying alone to learn for 3 days and its about time I hope I get some help..