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 7838555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:08:32+00:00 2026-06-02T15:08:32+00:00

Effectively, what I am attempting to do is enter a string similar to this

  • 0

Effectively, what I am attempting to do is enter a string similar to this string
into MySQL (it’s one line, made into two for readability)

fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;
stroke-linecap:butt;stroke-  linejoin:miter;stroke-opacity:1

MySQL allows me to INSERT the string into the field using phpMyAdmin and phpMyAdmin adds the field as (again one line, made into two for readability):

('fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-
linecap:butt;stroke-linejoin:miter;stroke-opacity:1'' in ''field list')

With my PHP code I attempted to add the in field list part to my code as follows

$rectangle_array[$rstyle] = $rectangle_array[$rstyle] . "' in ''field list'";
$mysql_rectangle_table_entry = "INSERT INTO $mysql_table VALUES
                               ($rectangle_array[$rstyle], 'rect',
                               $rectangle_array[$rid], $rectangle_array[$rwidth],
                               $rectangle_array[$rheight], $rectangle_array[$rx],
                               $rectangle_array[$ry])";
$run = mysql_query($mysql_rectangle_table_entry) or die(mysql_error());

And upon running the code I receive the following error.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;s’ at line 1

What can I do to make this work?

  • 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-02T15:08:33+00:00Added an answer on June 2, 2026 at 3:08 pm

    As noted in the comments…

    You could use mysql_real_escape_string() to escape any MySQL special characters before insertion.

    For example:

    $sql = "INSERT INTO my_table (string_column) VALUES ('" . mysql_real_escape_string($string) .  "')";
    

    Another option is to use Prepared Statements with PHP’s MySQLi or PDO.

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

Sidebar

Related Questions

Are there any tools to effectively compare two XML schema's? I have seen some
How effectively remove all character in string that placed before character .? Input: Amerika.USA
I'm effectively trying to deserialize a form. One of the objects on the serialized
I effectively want two nodes: Normal Node Premium Node The only difference will be
How does one effectively dispose a StringBuilder object? If an user generates multiple reports
I can effectively create a two column layout in a <select> by using JavaScript
Okay guys hopefully I can explain this effectively, so here goes. I have a
a similar issue appeared here: 3380458 : When attempting to select on focus using
I have a third party library that I'm attempting to incorporate into a simulation.
I'm getting some unexpected results calling one makefile from another. I have two makefiles,

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.