Jump to content

mmtalon

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by mmtalon

  1. MySQL syntax help "grave accent" !!! I was attemping to insert the $keys/values below into MySQL DB after including the latitude and longitude. Here are values ('37.833526' , '-122.27078'), respectively. code example: / *** Set $long_keys and $long_values *** / $long_keys = "(h_features,c_features,lat,long,dateposted,"; $long_values = " values ('$h_features','$c_features','$latitude','$longitude','$mysql_date'," ; I continued to get the error message "You have an error in your SQL syntax;". NOW, I was banging my head against a wall trying anything I could find to make this work, addslashes-real escapes-dbl and single quotes(with/without periods). Everything seemed to fail, until I remembered seeing some INSERT INTO code using the grave accent. To my surprise, this worked when I tried it. E.g. ($long_keys = "(h_features,c_features,`lat`,`long`,dateposted,";) By running some test, I know that the purpose of the accents has something to do with escaping the hyphen in the longitude value. Unsuccessfully, I have searched to find information on how PHP or MySQL is parsing this code. I was wonder if anyone has a clue to where I can get more information regarding the use of the "grave accent" punctuation in relation to PHP and MySQL??? I also welcome any knowledge that you have on this subject. Thank you in advance for your consideration and any input that you offer. Enquiry mind wants to know, mmtalon
×
×
  • 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.