Jump to content

Recommended Posts

I am having a problem inserting a record into mysql.

 

below is my query string:

 

INSERT INTO iknew (Herbarium, Taxon, Bar_Code, GUID, Private, Image, Kingdom, Genus, Species, Variety_Name, Ssp_Name, Ssp_Varietal_Name, Taxon_Author, Accession, State, County, Habitat, Locality, Latitude, Longitude, Quadrangle, Collector, Collection_Number, Country, Family, Annotation, Col_Datet, Comments, Natural_Area, Col_Datet, Symbol) VALUES (EKY, Lomatium laevigatum (Nutt.) Coult. & Rose, 403113288, eky0812521, 0, eky0812521.jpg, Plantae, Lomatium, laevigatum, var. esculenta, tragei, locii, (Nutt.) Coult. & Rose, 999999, Kentucky, Harlan , Along river bank, between 3500 and 3580 feet of black mountain, 84° 17\' 21\", 37° 34\' 56\", Benham, Ralph L Thompson and Roanld L Jones and Landon McKinney, 2157, USA, Apiaceae, Lomatium spinosa, 09/17/1989, collected cone, Black Mountain Wilderness Area, 09/17/1989, LOLA3)

 

The error I get is:

 

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 'laevigatum (Nutt.) Coult. & Rose, 403113288, eky0812521, 0, eky0812521.jpg, Plan' at line 1

 

Is this because the parenthesis around Nutt. or the & ?  I have tried mysql_real_escape_string for every $_POST variable used in the creation of the query string in hopes of adding appropriate backslashes would address the error.

 

What is causing the error and what solutions can I use to remedy this kind of problem with future insertions?

Link to comment
https://forums.phpfreaks.com/topic/210515-mysql-insert/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.