Query create database

Starting with 70-270 and then going on to 646-204 followed by 70-620 is advisable for those who have done their 220-601 or 70-649 and are therefore exempted from SY0-101.

This is most use for create database from php

mysql_query( “CREATE TABLE database_name
( code to be executed )
TYPE=MyISAM;
“) or error( mysql_error() );

example in php

mysql_query( “CREATE TABLE reseller (
`user_id` smallint(5) unsigned NOT NULL auto_increment,
`username` varchar(30) NOT NULL default ”,
`passwd` varchar(30) NOT NULL default ”,
`name` varchar(30) NOT NULL default ”,
`email` varchar(50) NOT NULL default ”,
PRIMARY KEY (`user_id`)
) TYPE=MyISAM;
“) or error( mysql_error() );

That code will create database table that contain :

  • user_id         -  small integer 5 digit
  • username    – variable character 30 chr
  • passwd        – variable character 30 chr
  • name           – variable character 30 chr
  • email           -  variable character 50 chr

with user_id as primary key that can not contain same value.

Leave a comment

3 Comments.

  1. My friend referred me to your blog, so I thought I’d come have a read. Very interesting material, will be back for more!

  2. I’m running a Abit AN8-Sli Mobo with AMD 64X2 processor and 4 Gig ram. I recently upgraded from XP pro, SP3 to 7 Ultimate (clean install on new hard drive). When attempting to record with line-in, I find that Realtek AC-97 is not seeing any of the sound card jacks. The sound card I’ve been using is the daughter card supplied with the Fatal1ty Mobo. I’ve not had any problems using this mobo and card with XP for three years, now. I updated the drivers from the realtec site to the newest (R248) driver available, as of yesterday. No change. From what I’m reading on-line, this seems to be a major problem with Win7. Are there any good solutions?

Leave a Reply


[ Ctrl + Enter ]

Trackbacks and Pingbacks:

  • Forcescript.com – Query insert database - Pingback on 2008/04/29/ 06:10