Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Insert (https://forums.graalonline.com/forums/showthread.php?t=134257371)

Immolate 12-20-2009 01:04 AM

Insert
 
PHP Code:

public function AddDatadata )
{
  
temp.sql "INSERT INTO immolate_items (name, display_name, power) VALUES(`" data[0] @ "`, `" data[1] @ "`, `" data[2] @ "`)";
  
sqlexecutetemp.sqlNULL );


seems to be throwing this error:

SQL Error: no such column: testsword
Query: INSERT INTO immolate_items (name, display_name, power) VALUES(`testsword`, `Testing Sword`, `3`)

Any ideas on what I'm actually doing wrong?

fowlplay4 12-20-2009 01:05 AM

Use single quotes instead of `.

Immolate 12-20-2009 01:20 AM

Quote:

Originally Posted by fowlplay4 (Post 1545689)
Use single quotes instead of `.

Great stuff, thanks.

WhiteDragon 12-20-2009 02:00 AM

The rule about quotes:
Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. Don't quote numbers.

Immolate 12-20-2009 02:06 AM

Quote:

Originally Posted by WhiteDragon (Post 1545727)
The rule about quotes:
Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. Don't quote numbers.

Duely noted, thanks. Quite sketchy when it comes to SQL.

12171217 12-20-2009 05:01 AM

Wow, GS2 supports SQL queries to remote servers?

That's awesome.

WhiteDragon 12-20-2009 05:07 AM

Nah, only to the built-in SQLite instance.


All times are GMT +2. The time now is 08:43 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.