Jump to content

allinarush

New Members
  • Posts

    2
  • Joined

  • Last visited

allinarush's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Im not that good at coding. Im I.T. and was hoping someone can help me resolve this. Why is it that mysql_connect works on my test script but not this original script?
  2. I have a site that is working on a hosted server. I setup PHP, MYSQL, and IIS on my local server. PHPMYADMIN works so I know that php is working. Im not that great at coding, and I keep getting errors at every turn. The hosted version of PHP that works is 5.6.-29, and the only version I could obtain was 5.6.30. So I changed it to mysqli, then I got an error about mysql_select, so I changed it to mysqli_select and now im getting What is confusing is that this test DB script works with mysql_connect just fine. Here is my original connection code... * Gets default mysql connection * * @param void * * @return resource */ public static function getDbConn($dbParams = null) { if ($dbParams !== null) { $host = $cfg['host']; $username = $cfg['username']; $password = $cfg['password']; $dbName = $cfg['dbName']; } else { if (self::$_conn) { return self::$_conn; } $host = SPC_DB_HOST; $username = SPC_DB_USERNAME; $password = SPC_DB_PASSWORD; $dbName = SPC_DB_DBNAME; } self::$_conn = mysqli_connect($host, $username, $password); mysqli_select_db($dbName); return self::$_conn; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.