Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PHP & MySQL insert question

New Here ,
May 24, 2010 May 24, 2010

Copy link to clipboard

Copied

I have a form that is inserting a selected color (e.g., #663300).  I want to insert the value into the database without the "#".  How do I delete that and just insert the actual numbers into the database?

TOPICS
Server side applications

Views

374
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 24, 2010 May 24, 2010

Copy link to clipboard

Copied

I just did a quick search on google for php strip characters and found some intersting results.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 31, 2010 May 31, 2010

Copy link to clipboard

Copied

LATEST

Let's say your color code is in $color_data variable:

INSERT INTO color_table(color_code) VALUES(SUBSTRING('{$color_data}', 2))

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines