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. Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/ 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. Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390287 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 Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390288 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. Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390291 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) Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390296 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 Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390303 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? Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390304 Share on other sites More sharing options...
Drags111 Posted November 13, 2007 Author Share Posted November 13, 2007 .... because Link to comment https://forums.phpfreaks.com/topic/77066-help-with-creating-a-mysql-table-in-php/#findComment-390396 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.