MadTechie Posted March 28, 2007 Share Posted March 28, 2007 I'm still getting the error after messing around with the database a bit, so what exactly do I need to do? Add the field Names to the Users table? Create a table called Names? I'm really confused. ??? What error ? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-216836 Share on other sites More sharing options...
VeronMan Posted March 30, 2007 Author Share Posted March 30, 2007 The error: Unknown column 'Name' in 'field list' Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-217987 Share on other sites More sharing options...
VeronMan Posted March 31, 2007 Author Share Posted March 31, 2007 *Bump* Any help with the error: Unknown column 'Name' in 'field list'? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-218492 Share on other sites More sharing options...
MadTechie Posted March 31, 2007 Share Posted March 31, 2007 Sorry dude, your on your own, i have tried OK Unknown column 'Names' in 'field list' if you get this error again then check the table for a field by that name, as you asked when it said ID Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-218849 Share on other sites More sharing options...
AndyB Posted March 31, 2007 Share Posted March 31, 2007 Good grief, this has been an unproductive thread so far. To summarize: You need to have a database (whose name you know) In that database you can have one table, two tables, as many tables as you want In each table, you define 'fields' (think of those like the cells in a table). The names are important. From the errors that you report, it looks as though you are trying to add data into fields that don't exist (case sensitivity matters). Without seeing any code at all, it's difficult to help you through what is essentially a very simple exercise. It may also be helpful for you to use phpAdmin to export the structure of your database table(s) and post that here. Then we'll all know just what fields are where and why, etc. so that we can suggest how you resolve your problems. If you get an error message it means exactly what it says. If there is an unknown column 'Names', it doesn't matter if you have a field called names, or Name, etc. only that you're trying to put data into a field that doesn't exist. One last pointer - don't use any of MySQL's reserved words as the names for database tables or database table fields. You can find the list at http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-218861 Share on other sites More sharing options...
VeronMan Posted April 2, 2007 Author Share Posted April 2, 2007 Okay, here's my exported phpMyAdmin file. -- phpMyAdmin SQL Dump -- version 2.9.2-rc1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Apr 02, 2007 at 03:43 AM -- Server version: 4.0.26 -- PHP Version: 4.4.2 -- -- Database: `107887` -- CREATE DATABASE `107887`; USE 107887; -- -------------------------------------------------------- -- -- Table structure for table `Names` -- CREATE TABLE `Names` ( `names` varchar(80) NOT NULL default '' ) TYPE=MyISAM; -- -- Dumping data for table `Names` -- -- -------------------------------------------------------- -- -- Table structure for table `Users` -- CREATE TABLE `Users` ( `firstname` varchar(30) NOT NULL default '', `surname` varchar(30) NOT NULL default '', `email` varchar(80) NOT NULL default '', `username` varchar(50) NOT NULL default '', `password` varchar(18) NOT NULL default '', `confirm` varchar(18) NOT NULL default '', `Names` varchar(50) NOT NULL default '' ) TYPE=MyISAM COMMENT='Registration Table'; -- -- Dumping data for table `Users` -- -- -------------------------------------------------------- -- -- Table structure for table `codes` -- CREATE TABLE `codes` ( `activation` varchar(6) NOT NULL default '', `code` varchar(6) NOT NULL default '', `id` varchar(10) NOT NULL default '' ) TYPE=MyISAM; -- -- Dumping data for table `codes` -- -- -- Database: `test` -- CREATE DATABASE `test`; USE test; Right now, i'm also attempting to obtain an SQL file from the creator of these PHP scripts, but I don't think he has one. But worth a try! Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-219675 Share on other sites More sharing options...
VeronMan Posted April 3, 2007 Author Share Posted April 3, 2007 Okay, so thats the SQL file there, posted above, what's wrong with my table? I posted my PHP register code on page 2 of this thread, so could somebody fix up the SQL table please? Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-220417 Share on other sites More sharing options...
MadTechie Posted April 4, 2007 Share Posted April 4, 2007 table is fine.. Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-220919 Share on other sites More sharing options...
VeronMan Posted April 4, 2007 Author Share Posted April 4, 2007 Okay, so where's the problem lie in the "Unknown column 'Name' in 'field list'?" thing then? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-221011 Share on other sites More sharing options...
MadTechie Posted April 4, 2007 Share Posted April 4, 2007 OK well you have been told a few times.. soo good luck Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-221655 Share on other sites More sharing options...
VeronMan Posted April 5, 2007 Author Share Posted April 5, 2007 Well, i'd just like to say thanks to everybody here on this forum that's helped me out with these scripts, and I know it's been a long and tedious process, but you've been great! Now, I managed to conjure up an SQL file from the scripts' author, so that should work perfectly! Once again, thanks for all your help! Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222036 Share on other sites More sharing options...
VeronMan Posted April 5, 2007 Author Share Posted April 5, 2007 Oh man, this is starting to suck real bad. Just tried to upload the SQL file I was given (below), and it came up with the following error: MySQL said: #1064 - 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 'CREATE TABLE `videos` ( `id` int(10) NOT NULL auto_increment And here's the SQL file, hopefully someone can quickly fix this up. CREATE TABLE `songs` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `videos` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `ringtones` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `backingmusic` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `midURL` varchar(255) NOT NULL, `docURL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `projects` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `language` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `pictures` ( `id` int(10) NOT NULL auto_increment, `pic` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `programs` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ---------------------------------------------------------------------- CREATE TABLE `codes` ( `id` int(10) NOT NULL auto_increment, `code` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `Users` ( `id` int(10) NOT NULL auto_increment, `Username` varchar(255) NOT NULL, `Password` varchar(255) NOT NULL, `Name` varchar(255) NOT NULL, `Email` varchar(255) NOT NULL, `Date` varchar(255) NOT NULL, `Level` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ---------------------------------------------------------------------- CREATE TABLE `animation` ( `id` int(10) NOT NULL auto_increment, `title` varchar(255) NOT NULL, `episodes` varchar(255) NOT NULL, `language` varchar(255) NOT NULL, `price` varchar(255) NOT NULL, `numcds` int(10) NOT NULL, PRIMARY KEY (`id`) ) Thanks for your time everyone! Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222048 Share on other sites More sharing options...
AndyB Posted April 5, 2007 Share Posted April 5, 2007 PRIMARY KEY (`id`) ) should be: PRIMARY KEY (`id`) ); Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222058 Share on other sites More sharing options...
VeronMan Posted April 5, 2007 Author Share Posted April 5, 2007 Cool, that worked fine, but now i'm getting this. Error SQL query: CREATE TABLE `songs` ( `id` int( 10 ) NOT NULL AUTO_INCREMENT , `artist` varchar( 255 ) NOT NULL , `title` varchar( 255 ) NOT NULL , `size` varchar( 255 ) NOT NULL , `URL` varchar( 255 ) NOT NULL , PRIMARY KEY ( `id` ) ); MySQL said: #1046 - No Database Selected There seems to be nothing wrong with the code... Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222092 Share on other sites More sharing options...
AndyB Posted April 5, 2007 Share Posted April 5, 2007 No Database Selected That's about as clear an error message as you could get. So, select a database before you create a table in it .... mysql_select_db($db_name) Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222600 Share on other sites More sharing options...
VeronMan Posted April 6, 2007 Author Share Posted April 6, 2007 Okay, now i'm using the SQL file below, but i'm still getting yet another error message. I think it's somethink to do with my selecting of the database. ??? mysql_select_db($107887) CREATE TABLE `songs` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `videos` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `ringtones` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `backingmusic` ( `id` int(10) NOT NULL auto_increment, `artist` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `midURL` varchar(255) NOT NULL, `docURL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `projects` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `language` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `pictures` ( `id` int(10) NOT NULL auto_increment, `pic` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `programs` ( `id` int(10) NOT NULL auto_increment, `picture` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `size` varchar(255) NOT NULL, `URL` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); ---------------------------------------------------------------------- CREATE TABLE `codes` ( `id` int(10) NOT NULL auto_increment, `code` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `Users` ( `id` int(10) NOT NULL auto_increment, `Username` varchar(255) NOT NULL, `Password` varchar(255) NOT NULL, `Name` varchar(255) NOT NULL, `Email` varchar(255) NOT NULL, `Date` varchar(255) NOT NULL, `Level` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); ---------------------------------------------------------------------- CREATE TABLE `animation` ( `id` int(10) NOT NULL auto_increment, `title` varchar(255) NOT NULL, `episodes` varchar(255) NOT NULL, `language` varchar(255) NOT NULL, `price` varchar(255) NOT NULL, `numcds` int(10) NOT NULL, PRIMARY KEY (`id`) ); Now what's the problem? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222683 Share on other sites More sharing options...
MadTechie Posted April 6, 2007 Share Posted April 6, 2007 Problem is you haven't post any errors Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222685 Share on other sites More sharing options...
VeronMan Posted April 6, 2007 Author Share Posted April 6, 2007 Ack! Sorry, I rushed when I was posting that, here's the error: MySQL said: #1064 - 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 'mysql_select_db($107887) CREATE TABLE `songs` ( `id` int( Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-222713 Share on other sites More sharing options...
VeronMan Posted April 7, 2007 Author Share Posted April 7, 2007 *Bump* Any help with the above error when I try to upload the SQL file? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-223462 Share on other sites More sharing options...
MadTechie Posted April 7, 2007 Share Posted April 7, 2007 remove "mysql_select_db($107887)" if your using phpMyAdmin and try R.T.F.M Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-223580 Share on other sites More sharing options...
VeronMan Posted April 8, 2007 Author Share Posted April 8, 2007 If I remove the "mysql_select_db($107887)" I get the error which I stated in my post up a few posts. I'm not really interested in R.T.M as I just need a quick-fix sort of solution for these scripts, i'm not going to be developing my knowledge of PHP/MYSQL any further than this. Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-224081 Share on other sites More sharing options...
MadTechie Posted April 8, 2007 Share Posted April 8, 2007 the script didn't come with compleate instructions which means their could be no end of problems.. theirs other sections that may help Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-224086 Share on other sites More sharing options...
VeronMan Posted April 8, 2007 Author Share Posted April 8, 2007 Hmm, ok, so basically your saying I won't be able to get these scripts working? Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-224104 Share on other sites More sharing options...
MadTechie Posted April 8, 2007 Share Posted April 8, 2007 I'm saying that with the amount of time spent you could of used a well documents class and been up and running aweek ago Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-224105 Share on other sites More sharing options...
VeronMan Posted April 9, 2007 Author Share Posted April 9, 2007 Yeah, and I agree with that wholeheartedly, but I don't need any more than what i've got in these scripts right here, and the time this has taken is a little bit annoying, but personally, I reckon this error: MySQL said: #1064 - 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 'mysql_select_db($107887) CREATE TABLE `songs` ( `id` int( is the last one, because other than this selecting the database stuff (AndyB told me to put the mysql_select_database($107887) thing in), the SQL file looks fine, and same with all the PHP scripts. This is the last error i'll ask help for, as there may be more, and I don't want to waste your time, but this last error, I require help with. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/43199-quick-question-on-php-register-and-login-scripts-mysql-error/page/2/#findComment-224741 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.