creating tables in php leads to errors in phpmyadmin....

Einfach Dinge, die nichts mit XAMPP, Apache Friends, Apache, MySQL, PHP und alle dem zu tun haben. Allerlei halt. ;)

creating tables in php leads to errors in phpmyadmin....

Postby unleash » 06. August 2014 12:01

what is dificult in creating this tables...

Code: Select all
CREATE TABLE `pois` (
  `id` bigint(20) unsigned NOT NULL,
  `lat` float(10,7) NOT NULL,
  `lon` float(10,7) NOT NULL,
  PRIMARY KEY (`id`)
)

CREATE TABLE `pois_tag` (
  `poisid` int(11) NOT NULL DEFAULT '0',
  `tagname` varchar(45) NOT NULL DEFAULT '',
  `tagvalue` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`poisid`,`tagname`)
)


i get back the following error ;

Code: Select all
MySQL meldet: Dokumentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version
for the right syntax to use near 'CREATE TABLE `pois_tag` (
  `poisid` int(11) NOT NULL DEFAULT '0',
  `tagname`' at line 8

many thanks for any and all help
unleash
 
Posts: 132
Joined: 03. December 2011 10:16
XAMPP Version: 5.6.3
Operating System: OpenSuse Linux 12.1

Re: creating tables in php leads to errors in phpmyadmin....

Postby Altrea » 06. August 2014 12:48

This error message is not related to your shown SQL statement
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6764
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: creating tables in php leads to errors in phpmyadmin....

Postby unleash » 06. August 2014 14:22

hello dear Altres - good day, :D


many thanksfor your answer. Youre very supportive and all your postings are a valuable asset of knowledge. Ready to apply in my work. :D

Many thanks for your answer. Well with this one i do not know how to apply...

BTW; Well i think i shoulde get rid of the back tics - what do you say!? They are only needed when table or column names conflict with reserved words and that is bad programming practice. In other words we don't need them. As to another specific problem, i have specified NOT NULL then set the default to null ('').

this might be a great issue - isnt it:

Question: how to set this correct... should i leave the expression " DEFAULT NULL "!´?

Code: Select all
CREATE TABLE `pois` (
  `id` bigint(20) unsigned NOT NULL,
  `lat` float(10,7) NOT NULL,
  `lon` float(10,7) NOT NULL,
  PRIMARY KEY (`id`)
)

CREATE TABLE `pois_tag` (
  `poisid` int(11) NOT NULL DEFAULT '0',
  `tagname` varchar(45) NOT NULL DEFAULT '',
  `tagvalue` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`poisid`,`tagname`)
)


can you give me a hint how to do this right!?

many thanks for any and all help.

greeetings
unleash
 
Posts: 132
Joined: 03. December 2011 10:16
XAMPP Version: 5.6.3
Operating System: OpenSuse Linux 12.1


Return to Allerlei

Who is online

Users browsing this forum: No registered users and 3 guests