Jump to content

creating table in database not working


Oliverkahn
Go to solution Solved by Oliverkahn,

Recommended Posts

i created a file called "general.sql" with the below code and uploaded it to the server....but when i checked the phpmyadmin its still tells me no table created

 

-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 27, 2012 at 06:25 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


-- Table structure for table `b_users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `userID` bigint(21) NOT NULL AUTO_INCREMENT,
  `username` varchar(60) NOT NULL DEFAULT '',
  `password` varchar(255) NOT NULL DEFAULT '',
  `files` varchar(100) ,
'wish' varchar(100) ,
  `email` varchar(255) NOT NULL DEFAULT '',
  `sex` char(7) NOT NULL,
'date' varch(20),
'ban' bigint(21),
'level' bigint(21),
PRIMARY KEY ('userID') 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

---table structure for files--

CREATE TABLE IF NOT EXIST 'files' (
'fileID' bigint(21) NOT_NULL AUTO_INCREMENT,
'file_name' varchar(50) NOT_NULL,
'description' varchar(200) NOT_NULL,
'comment' varchar(200),
'date' varchar(20) 
PRIMARY_KEY('fileID')
) ENGINE= MyISAM DEFAULT CHARSET=latin1
AUTO_INCREMEN=1;
 
what do i do pls
Link to comment
Share on other sites

What do you mean? That SQL script should create two tables, called  users and files

 

For the script to create the tables you need to first make sure you are logged in to phpMyAdmin, then select your database where you want the tables to be created and then click on the Import tab. Browse to the .sql file in your computer and then click the Go button. The two tables should now be created in your database.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.