If you think that this site is helpful, please recommend your friends to visit our site.
How to create database table in php?
The following is the code to create db table in php:
-------------------------------------------------------------------------------- < ?php /* Connecting, selecting database */ $link = mysql_connect("localhost", "bobsmith", "JM8t") or _ die("Could not connect"); /*print "Connected successfully";*/ mysql_select_db("bobsmith") or die("Could not select database"); mysql_query("create table record(Name VARCHAR(20), Sex VARCHAR(1), _ Age VARCHAR(2), Country VARCHAR(20), Education VARCHAR(20), _ Hobby VARCHAR(40), Email VARCHAR(40))"); print("Database table created!"); ? >--------------------------------------------------------------------------------
No comments:
Post a Comment