-1

I am working with data insertion in my sql database. I have a form, through which i am inserting some paragraph. The problem is whenever i try to insert this paragraph

Hi Friend, we will do it for you , we have a very good command on it , as we have been working with it since 3 years.We've done projects like you require, that's why we are excited to work on your project. We will assure you for quality work from our side. Working as a team , we came out with a quality work. I will show you my previouse work as well, Contact us for our professional work.Awaiting your reply.Regards, Team Code Tech

It shows me the follwing error, i guess i have missed something with the datatype of the column or what? The data type of the column is varchar(3000).

enter image description here

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121
Code Tech
  • 61
  • 7

3 Answers3

1

You will need to escape the paragraph properly, by adding slashes \ to the quotes in your paragraph, or using php's function to escape the paragraph.

ryo7689
  • 136
  • 4
0

You have Single Quotes in your paragraph.Escape the single quotes using \' for '. Replace all the single quotes like these.

Or otherwise Use prepared Statements,then you need not to worry

MohanaPriyan
  • 218
  • 3
  • 9
0

This is because the site where you are writing this comment, is not escaping their SQL appropriately, and the single quote We've is causing the query to break.

You can try entering your paragraph, without using concatenated words, like this:

Hi Friend, we will do it for you , we have a very good command on it , as we have been working with it since 3 years.We have done projects like you require, that is why we are excited to work on your project. We will assure you for quality work from our side. Working as a team , we came out with a quality work. I will show you my previouse work as well, Contact us for our professional work.Awaiting your reply.Regards, Team Code Tech

..and you may want to reconsidering using a site that has such poor coding; or offer you sevices to the site owner.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284