Categories > TinyButStrong general >

TinyButStrong Error - how to solve

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: NickM
Date: 2011-06-10
Time: 04:50

TinyButStrong Error - how to solve

I keep getting this error and don't know what's causing it:
TinyButStrong Error</b> when merging block [blk1]: MySql error message when opening the query: 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 'index' at line 1<br>

PHP and template are simple enough:
<?php
include_once('tbs_class.php');
//Connexion to the database
// Use the example below.
$cnx_id = mysql_connect('localhost','root','');
mysql_select_db('ftm',$cnx_id);
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('templ_index.html');
$TBS->MergeBlock('blk1',$cnx_id,'SELECT * FROM index');
$TBS->Show();
?>

HTML is
...
<table>
<tr><td>[blk1.index;block=tr]</td></tr>
</table>
...
I don't think I'm doing anything that would cause an error. Any idea how I can solve this problem?
I'm using XAMPP on Windows Vista 64/Apache/2.2.11 (Win32) /PHP 5.2.8/MySQL client version: 5.1.30
By: TomH
Date: 2011-06-10
Time: 11:26

Re: TinyButStrong Error - how to solve

You have used a reserved word (INDEX) in MySQL.

You will need to rename the table name from 'INDEX' to some other name. You cannot use MySQL reserved words as either table names or column/field names.

TomH