Please login or register.

Login with username, password and session length

News:

New to MS Chat? Why not introduce yourself!


Author Topic: Syntax Error using SQLite  (Read 184 times)

Offline cms07

  • cms07
  • MS Chat Defender
  • Sr. Member
  • *****
  • Posts: 366
  • Browser: Opera
  • Operating system: Windows Vista
  • Processor: Intel Core 2 Duo 1.6GHz
Syntax Error using SQLite
« on: May 31, 2010, 08:21:06 PM »
Hey guys. I'm inserting some stuff into an SQLite database.
Here's the error I'm getting:
Quote
Warning: sqlite_query() [function.sqlite-query]: near ",": syntax error in C:\wamp\www\sqlite\cms\install.php on line 54
and here's the line
Code: [Select]
sqlite_query($con, "INSERT INTO ".$s_dbprefix."_setting (variable, value) VALUES('siteurl','$s_url'),('sitename','$s_name'),('adminemail','$s_email')", null, $query_error);Any ideas?

Quote
Never trust a chart that you haven’t faked yourself!

Offline Ian

  • Administrator
  • Loyal Member
  • *****
  • Posts: 6,456
  • Browser: Firefox 3.6
  • Operating system: Windows 7 Home Premium
  • Processor: Intel Pentium 4 with HT
Re: Syntax Error using SQLite
« Reply #1 on: June 03, 2010, 10:21:40 PM »
SQLite doesn't support extended (multiple rows at once) inserts.

Offline cms07

  • cms07
  • MS Chat Defender
  • Sr. Member
  • *****
  • Posts: 366
  • Browser: Opera
  • Operating system: Windows Vista
  • Processor: Intel Core 2 Duo 1.6GHz
Re: Syntax Error using SQLite
« Reply #2 on: June 08, 2010, 09:21:10 PM »
SQLite doesn't support extended (multiple rows at once) inserts.
Oh. Well then.
Thanks aldo.

Quote
Never trust a chart that you haven’t faked yourself!

Offline cms07

  • cms07
  • MS Chat Defender
  • Sr. Member
  • *****
  • Posts: 366
  • Browser: Opera
  • Operating system: Windows Vista
  • Processor: Intel Core 2 Duo 1.6GHz
Re: Syntax Error using SQLite
« Reply #3 on: June 27, 2010, 07:12:43 PM »
It's time for round two.
Warning: sqlite_query() [function.sqlite-query]: near "group": syntax error in C:\wamp\www\sqlite\cms\install.php on line 61
Quote
[/code]sqlite_query($con, "CREATE TABLE ".$s_dbprefix."_user (id auto_increment PRIMARY KEY,name VARCHAR(25),password VARCHAR(25),regdate INT,email BLOB,gender VARCHAR(10),ip BLOB,group SMALLINT)", null, $query_error);
Code: [Select]
Is there anything fundamental I'm doing wrong?

Quote
Never trust a chart that you haven’t faked yourself!

Offline Ian

  • Administrator
  • Loyal Member
  • *****
  • Posts: 6,456
  • Browser: Firefox 3.6
  • Operating system: Windows 7 Home Premium
  • Processor: Intel Pentium 4 with HT
Re: Syntax Error using SQLite
« Reply #4 on: June 27, 2010, 10:35:21 PM »
Kinda need the query in order to be of any help...

Offline soren121

  • Master of HTML/CSS, Slave of PHP
  • Administrator
  • Hero Member
  • *****
  • Posts: 609
  • Browser: Chrome 6
  • Operating system: Windows 7
  • Processor: Intel C2D E7200
Re: Syntax Error using SQLite
« Reply #5 on: August 10, 2010, 06:40:21 PM »
SMALLINT isn't an acceptable datatype in SQLite 2.
LightBlog Developer - Fueled by Paramore, Frou Frou, Dr. Pepper and LOLCats

Offline Ian

  • Administrator
  • Loyal Member
  • *****
  • Posts: 6,456
  • Browser: Firefox 3.6
  • Operating system: Windows 7 Home Premium
  • Processor: Intel Pentium 4 with HT
Re: Syntax Error using SQLite
« Reply #6 on: August 10, 2010, 06:56:39 PM »
I think it is, actually. I remember using it, maybe (haven't touched SQLite in forever).

If I remember right, SQLite doesn't give a rats you know what... If the type doesn't exist, it treats it as a string... The only strongly typed, well type, in SQLite 2 is INTEGER.