Results 1 to 2 of 2

Thread: mysql and mysqli connect

  1. #1
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    379
    Thanks
    6
    Thanked 35 Times in 33 Posts

    Default mysql and mysqli connect

    This may seem extremely weird; however, i have a problem with mysql_connect and mysqli_connect

    PHP Code:
    $host "localhost";
    $username "";
    $password "";
    $database "bcelements";

    //Dies
    $con mysqli_connect($host,$username,$password$database) or die("Couldnt Connect to MYSQL!");

    //Doesn't die
    $con mysql_connect($host,$username,$password$database) or die("Couldnt Connect to MYSQL!");
    $con mysqli_connect($host,$username,$password); 
    If i use
    PHP Code:
    $con mysqli_connect($host,$username,$password); //or $con = mysql_connect($host,$username,$password);
    $selected mysql_select_db($database$con) or die("Crap you died"); //Dies 
    It still dies. Anyone have an idea of the problem?
    Last edited by Deadweight; 05-11-2014 at 04:51 PM.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    379
    Thanks
    6
    Thanked 35 Times in 33 Posts

    Default

    Well I fixed the errors. Just letting everyone know this for their personal information:
    localhost on php
    PHP Code:
    $host "127.0.0.1"
    $username "root"
    $password ""
    $database "bcelements";
    $con mysqli_connect($host,$username,$password$database) or die("Couldnt Connect to MYSQL!"); 
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. Change syntax from mysqli to mysql
    By newphpcoder in forum PHP
    Replies: 0
    Last Post: 10-27-2011, 08:34 AM
  2. Mysqli vs Mysql and CMS
    By Victro in forum MySQL and other databases
    Replies: 2
    Last Post: 06-16-2010, 01:14 PM
  3. mysql connect
    By lay in forum MySQL and other databases
    Replies: 3
    Last Post: 03-06-2009, 12:51 AM
  4. connect to mysql
    By froggy in forum MySQL and other databases
    Replies: 3
    Last Post: 01-07-2009, 04:55 PM
  5. Replies: 1
    Last Post: 12-03-2008, 02:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •