1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

mysql_connect() Problem

Discussion in 'PHP' started by Pudge1, Jan 24, 2015.

  1. #1
    
    <?PHP
    $conn = mysql_connect(“mysql.host.com”,“username”,“password”);
    
    mysql_select_db(“database”,$conn);
    ?>
    
    Code (markup):
    Parse error: syntax error, unexpected T_DNUMBER in /home/******/public_html/config.php on line 4

    Anyone have any ideas what is causing this?

    I've tried enclosing everything in the other kind of quotations and assigning variables and putting that into the function but I'm stumped on why this is coming out this way.
     
    Pudge1, Jan 24, 2015 IP
  2. kishore415

    kishore415 Well-Known Member

    Messages:
    1,462
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Hi,
    Just try replace " with single quotes..
     
    kishore415, Jan 24, 2015 IP
  3. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    I've already tried that with no success
     
    Pudge1, Jan 24, 2015 IP
  4. kishore415

    kishore415 Well-Known Member

    Messages:
    1,462
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Is it possible to provide access. I can check it..
     
    kishore415, Jan 24, 2015 IP
  5. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #5
    I have some coding on there I don't want to be available to anyone I don't know, so thank you but no.
     
    Pudge1, Jan 24, 2015 IP
    NetStar likes this.
  6. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #6
    Solved, result of some dumb text editor
     
    Pudge1, Jan 24, 2015 IP
  7. kishore415

    kishore415 Well-Known Member

    Messages:
    1,462
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    160
    #7
    Okay.. No problem..
     
    kishore415, Jan 24, 2015 IP
  8. ScottOtten

    ScottOtten Greenhorn

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #8
    Best way to code is use Text Editor like Notepad++ or PSPAD. You can also use IDE like eclipse for PHP
     
    ScottOtten, Feb 1, 2015 IP
  9. jslirola

    jslirola Active Member

    Messages:
    39
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    58
    #9
    if you allow me some advice, I recommend you use the mysqli_connect function instead of mysql_connect (this is deprecated).
     
    jslirola, Feb 5, 2015 IP