I'm using WampServer with phpmyadmin, but have also tried Xamp and same results.
I have 6 entries in the table called employees:
I have a table called employee with entries:
empId, lastName, firstName, department, position, and salary.
empId is primary key w/ auto increment. I'm following a tutorial online where they are using a mac computer, I'm on windows, in case that has something to do with the issue.
When I look at the SQL this produces it shows this:
SELECT * FROM `employee` WHERE 1
I don't see any CreateTable or other SQL.
Can anyone shed some light as to what is going on here? Thank you.
UPDATE:
So if I go to > Export to SQL:
And this is what I get:
CREATE TABLE IF NOT EXISTS employee (
empId int(11) NOT NULL,
lastName varchar(40) NOT NULL,
firstName varchar(20) NOT NULL,
department int(2) NOT NULL,
position varchar(20) NOT NULL,
salary int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE employee
ADD PRIMARY KEY (empI);
Which looks like the correct SQL.
So at least I know it is creating the correct SQL even though its not showing on the phpmyadmin web gui page.
A CREATE TABLE statement is just a command to create a table. You can also create a table using the GUI of PHPMyAdmin, in which case it performs the necessary actions for you.
But those are just commands, blue-prints if you like. In the database itself the 'Create table' statement doesn't exist. The database contains an actual table which was created using such a statement. When you export the database (like you did) or ask for the create table statement, it just reverse-engineers the actual table structure into a statement, like drawing a blue-print based on an actual object you have.
PHPMyAdmin will often show the statement that it generated to build -for instance- a table, but in some cases you may not see it. It might be that the guy of the tutorial has a slightly different version of PHPMyAdmin, or he activated a feature that shows the statement.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments