sqlite unrecognized token

2012-08-14   来源:站长日记       编辑:沧海桑田   类别:数据库    转载到:    发表评论

 through some good advise here, i migrated to sqlite. Love it! The switch was a breese.
however the import is not going well as it does not seem to like the punctuation.

 

PHP Code: "sqlite_exec() [function.sqlite-exec]: unrecognized token: "#" in "

mainly the "!", it seems to be treating it as an operator - example

$text = "That cow is GREEN!" <- this errors out on import.

How do you clean that? I cannot use "\!" as then the token error is "\"
cannot use """ then the "#" is the token error.

How do you clean up the strings?

did you try sqlite_escape_string?
DONE!
You have SQLite 2 because you're using the legacy SQLite extension. If I remember correctly, at the time this extension was introduced, SQLite 3 was new, so they made it for SQLite 2. However, SQLite 3 is now the major version of SQLite to use for new projects.

You have SQLite 2 because you're using the legacy SQLite extension. If I remember correctly, at the time this extension was introduced, SQLite 3 was new, so they made it for SQLite 2. However, SQLite 3 is now the major version of SQLite to use for new projects.

If you choose the PDO extension (which is enabled by default), the SQLite driver (which is enabled by default) will use SQLite 3. (Note the enabled by default thing: hence users of your script are not likely to require additional configuration to get PDO and/or its SQLite 3 driver working.)

To understand what I am talking about concerning prepared statements, read the PHP manual's entry on Prepared statements and stored procedures for PDO.

 

 
Quote Originally Posted by klyxmaster
There is one column for specifica genreid (all game genre's are broken down into numerical id's), the allgenreid is a list of other related genre's - so while one games' main genre is a hidden object(15) it may have other elements about the game such as puzzle, match3 etc..

I suggest that you take a step back to look at how you can design your database. Then, when you are parsing the XML document, you break down the data such that it will populate your database accordingly. XML is just being used here as a transport format. The numeric ids you have here are in CSV format, again used as a transport format. The idea is to convert the data from the transport format(s) into a storage format from which you can efficiently access and update the data.

In the event that you are unfamiliar or need a refresher into basic database normalisation, the article on Database Normalization and Design Techniques would be a place to start.

0

0
0|0 | 鲜花 VS 砸蛋 | 17阅读 0评论
 
不想登录?直接点击发布即可作为游客留言。
昵称  邮箱 网站 验证码 = 1+1