Jragon Posted July 10, 2010 Share Posted July 10, 2010 Hey, I got a little error when trying to use this code: <?php $link = mysql_connect('localhost', 'root', '') or die(mysql_error); $query = 'CREATE DATABASE IF NOT EXISTS frtdb'; mysql_query($query, $link) or die(mysql_error($link)); mysql_select_db('frtdb', $link); $query = 'CREATE TABLE track_data ( track_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, track_name VARCHAR(32) NOT NULL, track_desc VARCHAR(250) NOT NULL, track_maker VARCHAR(32) NOT NULL, track_data LONGTEXT NOT NULL, PRIMERY KEY (track_id) ) ENGINE=MyISAM'; mysql_query($query, $link) or die(mysql_error($link)); $query = 'CREATE TABLE user_info( user_id INT UNSIGNED NOT NULL, AUTO_INCREMENT, username VARCHAR(32) NOT NULL, password VARCHAR(32) NOT NULL, salt VARCHAR(32) NOT NULL, tracks_posted INT UNSIGNED NOT NULL, date_joined DATE NOT NULL, PRIMERY KEY (user_id)) ENGINE=MyISAM'; mysql_query($query, $link) or die(mysql_error($link)); echo 'Database and Tables made!!' ?> Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'KEY(track_id)) ENGINE=MyISAM' at line 7 Thanks If you can see anymore errors please tell me. Link to comment https://forums.phpfreaks.com/topic/207334-making-a-table-in-phpneed-some-help/ Share on other sites More sharing options...
jskywalker Posted July 10, 2010 Share Posted July 10, 2010 PRIMERY KEY change to: PRIMARY KEY Link to comment https://forums.phpfreaks.com/topic/207334-making-a-table-in-phpneed-some-help/#findComment-1084019 Share on other sites More sharing options...
Jragon Posted July 10, 2010 Author Share Posted July 10, 2010 Damn i hate not being able to spell! Link to comment https://forums.phpfreaks.com/topic/207334-making-a-table-in-phpneed-some-help/#findComment-1084025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.