Php > Code Snippets
Creating a table in a MySQL database
Creating a table in a MySQL database "; exit; } //create a table called contact , this will contain 2 fields . //fullname to store a name and email to store an email address $query = "create table contact" . "(fullname varchar(255), email varchar(255))"; //store this in $result variable $result = mysql_db_query ("mydb", $query); //if successful display this message if ($result) echo "Table 'mydb' was successfully created!"; //if unsuuccessful display the error message else echo mysql_errno().": ".mysql_error()."
"; mysql_close (); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage