Drags111 Posted November 12, 2007 Share Posted November 12, 2007 Hello everyone, I am trying to make a table for my MySQL db. I have the info for creating the table here: CREATE TABLE `members` ( `user_id` mediumint( NOT NULL auto_increment, `username` varchar(25) NOT NULL default '', `user_password` varchar(32) NOT NULL default '', `user_email` varchar(255) NOT NULL default '', PRIMARY KEY (`user_id`) ) TYPE=MyISAM AUTO_INCREMENT=60 ; How would I go about doing this? Thanks for all suggestions. Quote Link to comment Share on other sites More sharing options...
mybluehair Posted November 13, 2007 Share Posted November 13, 2007 ok. heres what to do. start a php file. here are the codes: <?php $database = "yourDB"; $username = "yourUN"; $password = "yourPASS"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die ( "unable to connect"); $query="CREATE TABLE `members` ( `user_id` mediumint( 8 ) NOT NULL auto_increment , `username` varchar(25) NOT NULL default , `user_password` varchar(32) NOT NULL default , `user_email` varchar(255) NOT NULL default , PRIMARY KEY (`user_id`) ) TYPE=MyISAM AUTO_INCREMENT=60 "; ?> and that should do it. Quote Link to comment Share on other sites More sharing options...
Drags111 Posted November 13, 2007 Author Share Posted November 13, 2007 Wow thanks man! Thanks for the fast reply. I'll learn this now Quote Link to comment Share on other sites More sharing options...
mybluehair Posted November 13, 2007 Share Posted November 13, 2007 sure. let me know if that works. not sure if i wrote out that query right or not. Quote Link to comment Share on other sites More sharing options...
Drags111 Posted November 13, 2007 Author Share Posted November 13, 2007 how do i see the table? like what do i do to know its there? (sorry for the noob questions) Quote Link to comment Share on other sites More sharing options...
Drags111 Posted November 13, 2007 Author Share Posted November 13, 2007 i went to the phpmyadmin after using the script, and it said no tables found, so i just made it using the query there. But yah i guess it didnt work, but no error showed up when i ran it :S Quote Link to comment Share on other sites More sharing options...
mybluehair Posted November 13, 2007 Share Posted November 13, 2007 well y didnt u just use phpadmin in the first place? Quote Link to comment Share on other sites More sharing options...
Drags111 Posted November 13, 2007 Author Share Posted November 13, 2007 .... because Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.