Ошибка incorrect table name

As soon as you say «I create a table per user» this is an antipattern I call Metadata Tribbles. The problem is that these tables tend to reproduce out of control. :-)

Instead, you should create one table, with a column for the user’s email as an attribute.

If you use delimited identifiers, SQL table names can contain special characters, or even whitespace, SQL reserved words, international characters, etc. But if you take the back-quotes off, @ and . are not valid characters for an identifier, because it confuses the SQL parser. Think about this: do you use any other programming languages that accept . as a valid character in a variable name or class name?

Other tips:

IP is more easily stored as INT UNSIGNED, and there are functions INET_ATON() and INET_NTOA() to convert an IP address string to and from the binary equivalent. This helps you make sure you don’t accidentally store an invalid IP address. Also you can use bitwise binary operators to do subnet masking operations against an IP address in binary form.

The columns FLD1, FLD2, FLD3 etc. are not descriptive and indicate that you haven’t designed this table sufficiently. You might even need to split this table into a few separate tables to manage multi-valued attributes. But one can’t tell how to do this since your columns are named so abstractly.

Ads were blocked — no problem. But keep in mind that developing HeidiSQL,
user support and hosting takes time and money. You may want to
send a donation instead.

1. Select table in the VT;
2. Select Data page, view table content;
3. Select Database page and refresh it by pressing F5 button;
4. Return to Data page and try to refresh data by pressing F5 button;
5. See error massage: SQL Error (1103): Incorrect table name »

Sorry.
Screenshot

Table structure:

CREATE TABLE `rep_triggers` (
`gid` INT(3) UNSIGNED NOT NULL,
`trigger` VARCHAR(50) NOT NULL,
`name` VARCHAR(100) NOT NULL,
`url` VARCHAR(100) NULL DEFAULT NULL,
`mark` INT(1) UNSIGNED NOT NULL DEFAULT '0',
`mark2` INT(1) UNSIGNED NOT NULL DEFAULT '0',
`DTLM` INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (`trigger`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM;

Ah, thanks for the enlightment. I assume you did update your heidisql.exe to a nighly build which then fixed it, as I recall there was a recent fix for exactly this error.

Hi,

I am having the save problem with «SQL Error (1103): Incorrect table name «

here is what’s been triggering the 1103 error code:

SQL query:

CREATE TABLE `admin_pay’ (
` pay_id ‘ bigint(20) NOT NULL auto_increment, `pay_amount’double NOT NULL default ‘0’,
PRIMARY KEY ( `pay_id` ) );

MySQL said: Documentation
#1103 — Incorrect table name ‘admin_pay’ (

I tried adding the

)
COLLATE=’utf8_general_ci’
ENGINE=MyISAM;

to the original SQl.php script like this:

CREATE TABLE `admin_pay’ (
`pay_id’ bigint(20) NOT NULL auto_increment,
`pay_amount’ double NOT NULL default ‘0’,
PRIMARY KEY (`pay_id`)
);


— Dumping data for table `admin_pay`

INSERT INTO `admin_pay` VALUES (1, 0);
)
COLLATE=’utf8_general_ci’
ENGINE=MyISAM;

but it still returned the same 1103 error code.
Can you offer any suggestions that might help solve this error problem?

You have the table name enclosed in two different quote chars: backtick and single quote. Only backticks are allowed quote chars in mysql.

Thank you for bringing that to my attention! Before you mentioned it, I didn’t know a «backtick» and a «single quote» were different. Indeed I did add some «single quotes» to the sql.php page because the «backticks» were so faint and hard to see. I had no clue I was effectively messing up the sql.php page by adding those single quotes to it. Excellent call!

However, I have now replaced all the single quotes I had previously changed, and put with «backticks» in their place. But I’m still get the same «1103» error flag.

So, apparently the » SQL Error (1103): Incorrect table name» error flag I’m getting isn’t being triggered by the single quotes I had added to the page. But rather, it’s being triggered by different problem I haven’t been able to locate yet.

Excellent call, though. Thank you so much for pointing that out! Do you have any more ideas I might try?

when I execute

CREATE TABLE admin_pay (
pay_id bigint(20) NOT NULL auto_increment,
pay_amount double NOT NULL default ‘0’,
PRIMARY KEY (pay_id)
);

it works ok on my system. don´t know why you use all the quotes.

CREATE TABLE admin_pay (
pay_id bigint(20) NOT NULL auto_increment,
pay_amount double NOT NULL default ‘0’,
PRIMARY KEY (pay_id)
)
COLLATE=utf8_general_ci
ENGINE=MyISAM;

works as well.

Wow…I am thoroughly hyped now! I got it to work just as you said! Once I replaced all the single quotes with backticks, it works great! Thanks again!

Maybe you can help me with another issue?

— Table structure for table `affil_heap_sessionid`

CREATE TABLE `affil_heap_sessionid` (
`heap_id` bigint( 20 ) NOT NULL default ‘0’,
`heap_name` varchar( 255 ) NOT NULL default ‘0’,
`heap_regdate` datetime NOT NULL default ‘0000-00-00.00.00’,
`heap_approved` bigint( 20 ) NOT NULL default ‘0’,
`heap_pending` bigint( 20 ) NOT NULL default ‘0’,
`heap_paid` bigint( 20 ) NOT NULL default ‘0’,
PRIMARY KEY ( `heap_id` )

I’m getting a syntax error 1064 that states:
Message: %s near ‘%s’ at line %d

The heap_regdate column has an invalid default value:
Wrong: 0000-00-00.00.00
Right: 0000-00-00 00:00:00

Got it. Thank you again. Everything seems to be working great now. Couldn’t have done it without your help. Many thanks!

CREATE TABLE `project`.`registration ` (

`name ` VARCHAR( 200 ) NOT NULL ,
`email` VARCHAR( 200 ) NOT NULL ,
`password` VARCHAR( 100 ) NOT NULL ,
`mobile` VARCHAR( 100 ) NOT NULL ,
`dob` VARCHAR( 100 ) NOT NULL ,
`pre_add` VARCHAR( 200 ) NOT NULL ,
`profession` VARCHAR( 200 ) NOT NULL ,
`org` VARCHAR( 200 ) NOT NULL ,
`designation` VARCHAR( 200 ) NOT NULL ,
`passyr` DATE NOT NULL ,
`passgrp` VARCHAR( 100 ) NOT NULL ,
`gender` VARCHAR( 50 ) NOT NULL ,
`m_status` VARCHAR( 50 ) NOT NULL ,
`bloodgrp` VARCHAR( 50 ) NOT NULL ,
`sl` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`par_add` VARCHAR( 200 ) NOT NULL ,
PRIMARY KEY ( `sl` )
) ENGINE = INNODB;

MySQL said: Documentation

#1103 — Incorrect table name ‘registration ‘

Same problem in previous post, I guess.

CREATE TABLE `tezaver_metaphone ` (
    `term` VARCHAR(400) NOT NULL,
    `metaphone` TEXT NOT NULL
)
COLLATE='utf8_slovenian_ci'
ENGINE=MyISAM
;

/* SQL Error (1103): Incorrect table name 'tezaver_metaphone ' */

Note space after ‘tezaver_metaphone ‘, that could be auto removed by Heidi, I guess.

I run into this error message using the following workflow. Let me know if this should be a new ticket instead.

SQL Error (1103): Incorrect table name »

Version: 9.4.0.5174 / MariaDB server
Steps to reproduce:

  1. Open any tables data tab
  2. Go back to the tree or database views
  3. Drop that table
  4. Go back to the data tab
  5. Refresh
  6. See this error
  7. Run a script or use a different client to re-create the table
  8. Refresh again

The heidi client is requesting «SELECT * FROM db.« LIMIT 1000;»

Proposed ideas:

  • Dropping a table should keep the old table name around, and properly tell you dropped_table doesn’t exist
  • Have Data tab realize there is no table, so refresh isn’t an option

Please login to leave a reply, or register at first.

This page uses cookies to show you non-personalized advertising and server usage statistic diagrams.

  • #1

Срочно нужна помощь! Ошибка 1103 — Incorrect table name »!

Всем привет!

Раньше инклудил файлы просто инклудом, что иногда вызывало ошибки в тех случаях, когда я обновлял сайт. То есть когда закачиваю новые файлы, старые удаляются, новых еще нет, поэтому возникали ошибки при инклуде еще не существующих файлов.
Сейчас решил сделать так: проверять файл на наличие и потом инклудить. А в случае его отсутствия сообщать, что в данный момент происходит обновление сайта.
В общем сделал. С теми файлами, в которых была только текстовая информация, вставляются нормально.
Но почему-то появилась ошибка 1103 (Incorrect table name ») в тех случаях, когда вставляется моим способом файл, в которых прописаны функции и переменные. Как будто переменных не видит.
Подскажите, плиз, в чем проблема? Понять никак не могу.
Спасибо!

-~{}~ 23.12.06 02:42:

Вроде что-то понял, только вот что именно не пойму. Прошу помочь доразобраться.
У меня инклуд работает через функцию:
function incf($file)
{
if (file_exists($file))
{ include($file); }
else
{ echo «Сейчас происходит обновление сайта…»; }
}

А вставляю вот так: incf(«file.txt»);
Так вот, если file.txt — это файл с функциями и переменными, тогда возникает ошибка.
Я вычислил методом тыка, что ошибка в том, что мой инклуд работает через функцию. Без функции работает нормально. А как сделать, чтобы и с функцией было все ОК?

Написано же некорректное имя таблицы , пишите просто без `wert`,и у вас прям не дыра,а дырище для выполнение sql-инъекции, используйте PDO или Mysqli и фильтруйте входные данные
UPD: Поддерживаю Иван Корюков так как вы делаете делать не стоит
сделайте таблицу users

CREATE TABLE `users` (`ID` char(255) not null, `username` char(255), `Page` char(255), `Class` char(255),`Top` float,`Left` float, PRIMARY KEY(`ID`))

и пишите в нее все что вам надо, не стоит плодить кучу таблиц

вот код в котором ваш вариант работает

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<form action="" method="POST">
		<input type="text" name="user">
		<input type="submit" value="submit">
		<?php 
		$user = $_POST['user'];
		$w = "CREATE TABLE `".$user."` (`ID` char(255) not null, `Page` char(255), `Class` char(255),`Top` float,`Left` float, PRIMARY KEY(`ID`))";
		$link = mysql_connect('localhost', 'root', '');
		mysql_select_db('test-new',$link);
		echo mysql_query($w);
		

			

		?>
	</form>
</body>
</html>

  • Laravel Version: #.#.# Laravel Framework 5.6.38
  • PHP Version: PHP Version 7.1.9
  • Laravel-admin: #.#.# latest

Description:

D:xampphtdocslara-admin>php artisan admin:install

IlluminateDatabaseQueryException : SQLSTATE[42000]: Syntax error or access
violation: 1103 Incorrect table name » (SQL: create table « (id int unsigne
d not null auto_increment primary key, `username` varchar(190) not null, `passwo
rd` varchar(60) not null, `name` varchar(255) not null, `avatar` varchar(255) nu
ll, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at
` timestamp null) default character set utf8mb4 collate ‘utf8mb4_unicode_ci’)

at D:xampphtdocslara-adminvendorlaravelframeworksrcIlluminateDatabase
Connection.php:664
660| // If an exception occurs when attempting to run a query, we’ll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se’s errors.
663| catch (Exception $e) {

664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Steps To Reproduce:

php artisan admin:install

  • Ошибка incorrect id 45 easyanticheat
  • Ошибка incorrect id 217
  • Ошибка incorrect expiry date
  • Ошибка include fastled h на ардуино нано
  • Ошибка inappropriate ioctl for device