Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Hoping you dudes know what connect.php is =0

    I downloaded a script for a game...

    This is my connect.php file.

    Code:
    <?php
    
    session_start();
    ob_start();
    
    $connect = mysql_connect("*localhost","","");
    if($connect == TRUE) {
     if(mysql_select_db("") != TRUE) {
      exit("<span style='color: red'>Can't connect to the MySQL database. Please contact the webmaster.</body></html>");
     }
    }else{
     exit("<span style='color: red'>Can't connect to the MySQL server. Please contact the webmaster.</body></html>");
    }
    ?>
    I'm using a free host called 110mb for a while to test it out and make sure it runs smooth.
    PHP Ver: 5.1.6
    MySQL Ver: 5.0.27

    Any help is appreciated!

    Try to keep it simple! I am complete noob to this coding!
    Last edited by 2Pacalypse; 07-17-2008 at 10:21 PM. Reason: Typos

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    What's the question?

  • #3
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Question is what do I do to finish the code

    Sorry I diddn't type that in original message

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Thats all a connect.php file really needs.

  • #5
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts
    But on the line where it says:
    $connect = mysql_connect("*localhost","","")

    Don't you need something between to other double quote things (")?

  • #6
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts

  • #7
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Yes first set of double quotes is for username to the mysql database e.g.
    PHP Code:
    mysql_connect("localhost""2Pacalypse"""); 
    Third set is for your password e.g.
    PHP Code:
    mysql_connect("localhost""2Pacalypse""Rafiki"); 
    Edit:
    Or read above

  • Users who have thanked rafiki for this post:

    2Pacalypse (07-17-2008)

  • #8
    New Coder
    Join Date
    Jul 2008
    Posts
    96
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Oh, thank you!

    110mb doesn't offer them databases on a free subscription

    Thanks...
    I was trying to put in my login details for my 110mb account

    Thanks to all


  •  

    Posting Permissions

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