Welcome Guest, Not a member yet? Register   Sign In
error database please help
#1

[eluser]jonny tran[/eluser]
error here:
A Database Error Occurred
Error Number: 1064

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 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bid' at line 1

update products set `Code`= 'sd', `CategoryID`='42', `Quantity`='3', `ProductName`='ds',`ImageThumb`='',`ImageDetail`='', `Price`='3', `Description`='

- Dùng để chế biến: ướp chiên, xà o.

- Dùng để chấm.

- Cách bảo quản: Bảo quản nơi thóang mát, sạch sẽ, tránh ánh sáng mặt trời chiếu trực tiếp. Đóng nắp sau khi sử dụng.

', `Active`='1' where ProductID='136'


error in IE8
#2

[eluser]flaky[/eluser]
Are you using active record or are you writing yourself the update query?
#3

[eluser]jonny tran[/eluser]
I write in a query
#4

[eluser]jonny tran[/eluser]
This error only happen on IE, Firefox no contest, please fix this
#5

[eluser]flaky[/eluser]
No one is here to fix your problems, you should fix them yourself.
I suggest you use Active Record

Code:
//$data - is the array containing the fields and data to be updated

$this->db->where('ProductID', 136);
$this->db->update('products', $data);
#6

[eluser]danmontgomery[/eluser]
[quote author="jonny tran" date="1280409701"] ‘Times New Roman’; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bid’[/quote]

Looks like you're pasting something directly from MS Word, and the quotes are messing up your query. You can use active record like flaky suggests, which will escape the string for you, but what you really should be doing is sanitizing your data before you insert it into the database.




Theme © iAndrew 2016 - Forum software by © MyBB