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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Single Quotes in mysql statements (PHP)

    Should I be using single or double quotes in statements such as
    PHP Code:
    $db mysql_connect ("localhost""user""password"); 
    I know double quotes work, but I know PHP doesn't parse single quotes (therefore faster execution) and *most* statements seem to work fine with single quotes.

  • #2
    New Coder
    Join Date
    Mar 2003
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi

    to be honest i would just use double quotes

    pete

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    It really makes no difference in this case, but if you had variables to fill in these areas, then you could only use double quotes or none at all, single quotes won't parse the variables.

  • #4
    Registered User
    Join Date
    Jan 2004
    Location
    Florida
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I use double quotes if it's like that. If they are variables, i use no quotes at 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
    •