News:

The "Support Requests" forum is now viewable by guests.

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - wstreet

#1
Thanks for the feedback...

I have setup my database in my control panel. I've got my db_name, db_username and db_password.

However, I am not sure how to make sure that I am using mysql_connect() to connect to the database server first, as you suggested.

This is the mysql.lib file that I have installed on the web server:
<?
  $connected = false;
  function c()
  {
      global $db_host, $db_login, $db_pswd;

      $db = @mysql_connect($db_host, $db_login, $db_pswd);
      $connected = true;
      return $db;
  }

function q($q_str)
{
    global $db_name, $connected;
    if(!$connected)
    {
       c();
    }

    $r = mysql($db_name, $q_str);
    return $r;
}

function d($db)
{
    @mysql_close($db);
}

function e($r)
{
  if(@mysql_numrows($r))
   return 0;
  else return 1;
}

function f($r){
  return @mysql_fetch_array($r);
}

function nr($r){
  return @mysql_num_rows($r);
}
?>
#2
Trouble with connecting to mysql.

I am getting the following 2 messages:

Warning: mysql() [function.mysql]: Access denied for user 'apache'@'localhost' (using password: NO)

Warning: mysql() [function.mysql]: A link to the server could not be established

Any suggestions.