Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 700259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:28:39+00:00 2026-05-14T03:28:39+00:00

Spent some time troubleshooting a problem whereby a PHP/MySQL web application was having problems

  • 0

Spent some time troubleshooting a problem whereby a PHP/MySQL web application was having problems connecting to the database. The database could be accessed from the shell and phpMyAdmin with the exact same credentials and it didn’t make sense.

Turns out the password had a $ sign in it:

$_DB["password"] = "mypas$word";

The password being sent was “mypas” which is obviously wrong.

What’s the best way to handle this problem? I escaped the $ with a \

$_DB["password"] = "mypas\$word";

and it worked.

I generally use $string = 'test' for strings which is probably how I avoided running into this before.

Is this correct behavior? What if this password was stored in a database and PHP pulled it out – would this same problem occur? What am I missing here…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:28:39+00:00Added an answer on May 14, 2026 at 3:28 am
    $_DB['password'] = 'mypas$word';
    

    Single quote strings are not processed and are taken “as-is”. You should always use single quote strings unless you specifically need the $variable or escape sequences (\n, \r, etc) substitutions. It’s faster and less error prone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've spent some time researching how to communicate with SAP from a PHP web
I spent some time having problems with this so, thought I would share the
I spent some time looking around, and all I could find is Jython. It's
I have spent some time now to solve a problem for which i have
I've spent some time with new Database project in VS 2008 and decided to
I've spent some time searching around how to configure NHibernate's FlushMode so it could
Having spent some time migrating old data into a new drupal site, my first
I've spent some time trying to find a way CodeRush could add using when
I'm having some trouble mapping a byte array to a MySQL database in Hibernate
Having spent some time working on data warehousing, I have created both ETL (extract

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.