รบกวนถามเกี่ยวกับการ update ข้อมูลลง Database

Locked
flourz
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jun 20, 2011 4:37 pm

รบกวนถามเกี่ยวกับการ update ข้อมูลลง Database

Post by flourz » Fri Feb 10, 2012 6:44 pm

คือว่าต้องการจะ update ข้อมูลลงตารางใน database ค่ะแต่ว่า ข้อมูลที่ต้องการจะ add ลงไปมันเป็นฟังชันก์(Geometry function) ทำให้มันไม่สามารถ add column นี้ลงในตารางได้ค่ะ เพราะมันดันไปอยู่ภายใน " "

error
Save failed with the following error: GeoLocationTableGeoLocation: :store failed
Cannot get geometry object from data you send to the GEOMETRY field
SQL=UPDATE `jos_place` SET `lat`='14.075591',`lng`='100.617218',`placeName`='University',`placeAddress`='111 ม.18 ต.คลองหนึ่ง อ.คลองหลวง',
`placeProvince`='ปทุมธานี',`placePostalCode`='12121',`placeMainPhone`='02564444444',
`placeMobilePhone`='',`placeFaxPhone`='025644493',`placeEmail`='@gmail.com',
`placeDescription`='มหาวิทยาลัย',`location`='GeomFromText(\'POINT(14.075591 100.617218)\')',`catid`='0' WHERE placeCode='1'
location`='GeomFromText(\'POINT(14.075591 100.617218)\')' column นี้ค่ะที่เป็นปัญหา

รบกวนขอคำแนะนำด้วยนะค่ะ ว่าควรทำยังไงดีค่ะ
ขอบคุณมากค่ะ

User avatar
aodto
Joomla! Explorer
Joomla! Explorer
Posts: 397
Joined: Mon May 03, 2010 5:18 am
Location: Thailand
Contact:

Re: รบกวนถามเกี่ยวกับการ update ข้อมูลลง Database

Post by aodto » Mon Feb 13, 2012 7:34 am

$text = $database->Quote($text);
หรือ
$text = $database->getEscaped($text);

ลองดู 2 ตัวอย่างข้างบน ก่อนเอาข้อมูลลงฐานข้อมูลครับ
MongoDB-as-a-Service in Thailand: http://www.thaimongo.com
โฮสติ้งรองรับ 4 ภาษา PHP Python Ruby Node.js ใช้งานฟรี: http://www.phalconhost.com

flourz
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jun 20, 2011 4:37 pm

Re: รบกวนถามเกี่ยวกับการ update ข้อมูลลง Database

Post by flourz » Tue Feb 14, 2012 5:18 am

aodto wrote:$text = $database->Quote($text);
หรือ
$text = $database->getEscaped($text);

ลองดู 2 ตัวอย่างข้างบน ก่อนเอาข้อมูลลงฐานข้อมูลครับ

ขอบคุณค่ะ เด๋วจะลองทำดู ถ้ามีปัญหาจะมากถามใหม่ค่ะ :))


Locked

Return to “Thai Forum”