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

  • SEARCH
  • Home
  • 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 8356201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:06:54+00:00 2026-06-09T10:06:54+00:00

I am using PHP to populate a database of company records. I have a

  • 0

I am using PHP to populate a database of company records. I have a field for company name and the currency type that they use.
But when I use PHP the record never gets inserted if the currency is an Enlglish pound sign (£). A dollar sign ($) or any other normal character is no problem. The record with a pound sign inserts just fine when I run the sql statement and enter it directly into MySQL Query Browser. But it just doesn’t work when I run the exact same INSERT statement in PHP.

$sql = "INSERT INTO company_test (name, currency) VALUES ('ABC Widgets', '£')";   
$rs = mysql_query($sql, $conn);
//Does not insert a record

$sql = "INSERT INTO company_test (name, currency) VALUES ('ABC Widgets', '$')";   
$rs = mysql_query($sql, $conn);
//A record inserts just fine

//My MySQL version is 5.5.11.  PHP is version 5.3.6.  
//The MySQL table looks like this:
TABLE company_test
FIELD | id       | INTEGER(10) | not null | auto increment
FIELD | name     | VARCHAR(45) | not null
FIELD | currency | VARCHAR(3)  

In MySQL Query Browser the “Table Options” tab shows that for this company_test table my charset is utf8.

Thanks.

  • 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-06-09T10:06:57+00:00Added an answer on June 9, 2026 at 10:06 am

    Check for errors:

    $rs = mysql_query($sql, $conn) or die(mysql_error());
                                   ^^^^^^^^^^^^^^^^^^^^^
    

    Never assume a query succeeds. Even if your sql syntax is perfect, there’s far too many other reasons for failure to NOT check.

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

Sidebar

Related Questions

Suppose that I have a database query which looks like below - select name,
I have a homepage that contains a huge amount of php code to populate
I'm currently using php to populate a form with selections from a database. The
Using PHP, I am trying to delete a record, but I want to check
using php and mysql I have two tables, a users table and a profiles
I have a PHP web app that generates a somewhat complex report from our
I tried to populate google chart datatable in server side using PHP.I got JSON
I'm building a jQuery Mobile site, using PHP to interact with a MySQL database
I have four DB tables in an Oracle database that need to be rewritten/refreshed
I'm using C# with .NET 4 (though as per company policy, we never use

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.