PDA

View Full Version : SQL Database: phpMyAdmin tables?


jacob1986
06-13-2015, 09:49 PM
I would like to create a basic SQL table using my database in the phpMyAdmin application but I keep getting errors. The code I have is as followed:

CREATE TABLE blog (
<column1><column1Type><column1Details>
<column2><column2Type><column2Details>
<column3><column3Type><column3Details>
...
);

I have taken all information from the book (Beginning PHP & MySQL Development), which can be found at the link below. Is the code - actual working code... or just an illustration for reference?

Book link:
https://books.google.co.uk/books?id=hwVdCAAAQBAJ&pg=PT131&lpg=PT131&dq=the+basic+form+of+SQL+command+for+creating+tabl e&source=bl&ots=NvjIgIimgd&sig=khkv0a5BeoOptUp5cAWaHoW0UAM&hl=en&sa=X&ved=0CFcQ6AEwDGoVChMIs7Te8_SMxgIVCj4UCh3hYQDc#v=on epage&q=the%20basic%20form%20of%20SQL%20command%20for%20 creating%20table&f=false

edbr
06-15-2015, 01:09 AM
illustration. if you scroll down it gives an example.
heres another

CREATE DATABASE IF NOT EXISTS `new test` ;
USE `new test`;

CREATE TABLE IF NOT EXISTS `user` (
`id` int(3) NOT NULL AUTO_INCREMENT,
`user` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Are you working live or ob a local test server?