jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 @Doc, I don't know why your database structure looks like this: Array ( o=> u_id [Field] => u_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => PRI [Key] => PRI [4] => [Default] => [5] => auto_increment [Extra] => auto_increment ) Array ( o=> id [Field] => id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( o=> site_id [Field] => site_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( etc..... ) I'd give you advise, to create the same table again.. Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 @Doc, I don't know why your database structure looks like this: Array ( o=> u_id [Field] => u_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => PRI [Key] => PRI [4] => [Default] => [5] => auto_increment [Extra] => auto_increment ) Array ( o=> id [Field] => id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( o=> site_id [Field] => site_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( etc..... ) I'd give you advise, to create the same table again.. How would re-creating the same table do any good? If there is something wrong with my current setup? Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 @Doc, take a look at this link -> http://www.reg.ca/faq/PhpMyAdminTutorial.html Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 @Doc, take a look at this link -> http://www.reg.ca/faq/PhpMyAdminTutorial.html All that shows me is how to use phpmyadmin.. Which I already know how to use (and use on a regular basis). Here is the table we have been working on in PHPMyAdmin with the data that went in there before the form just magically "stopped working". Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 How did you create this table, manually through phpmyadmin or with script got from somewhere ? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 How did you create this table, manually through phpmyadmin or with script got from somewhere ? Manually through PhpMyAdmin Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Okay, go to phpmyadmin again and export the table. Post out only the line(s) that begin with, Example CREATE TABLE IF NOT EXISTS `tbl_name` ( `id` int(11) NOT NULL, `name` varchar(244) NOT NULL, `email` varchar(14) NOT NULL, `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 OP: Your ID value has probably exceeded the maximum allowed. You should use an auto incrementing ID over a generated ID. Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Okay, go to phpmyadmin again and export the table. Post out only the line(s) that begin with, Example CREATE TABLE IF NOT EXISTS `tbl_name` ( `id` int(11) NOT NULL, `name` varchar(244) NOT NULL, `email` varchar(14) NOT NULL, `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `applications` ( `u_id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL, `site_id` int(11) NOT NULL, `timestamp` int(55) NOT NULL, `ip` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `username` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `steam` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `xfire` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `games` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, `why_join` longtext COLLATE utf8_unicode_ci NOT NULL, `clan_history` longtext COLLATE utf8_unicode_ci NOT NULL, `recruit` varchar(300) COLLATE utf8_unicode_ci NOT NULL, `age` int(3) NOT NULL, `location` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `microphone` int(11) NOT NULL, `recruit_style` int(11) NOT NULL, `app_status` int(11) NOT NULL, `division` varchar(150) COLLATE utf8_unicode_ci NOT NULL, `notes` longtext COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`u_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ; Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 OP: Your ID value has probably exceeded the maximum allowed. You should use an auto incrementing ID over a generated ID. The unique ID/Primary ID is auto incrementing. The generated ID is used elsewhere on this site. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 Has it exceeded the max value for a signed int? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Has it exceeded the max value for a signed int? It's quite possible. I do not know. Is there a way to limit how high the generated number goes? I can change the number of characters from 6 to something else? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 Also you're saying you don't get an error from the or die(mysql_error()) part, but the query doesn't execute? Do you have error reporting turned on and error logging off for dev? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Also you're saying you don't get an error from the or die(mysql_error()) part, but the query doesn't execute? Do you have error reporting turned on and error logging off for dev? Error Reporting should be turned on. When I added "ini_set('display_errors', 1); error_reporting(E_ALL);" to the page, an error was shown.. But I fixed it, and now no errors. However, the query still does not execute successfully. Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 There is nothing wrong, I just created few minutes ago the same table and that's correct result: Array ( [0] => u_id [Field] => u_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => PRI [Key] => PRI [4] => [Default] => [5] => auto_increment [Extra] => auto_increment ) Array ( [0] => id [Field] => id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => site_id [Field] => site_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => timestamp [Field] => timestamp [1] => int(55) [Type] => int(55) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => ip [Field] => ip [1] => varchar(100) [Type] => varchar(100) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => name [Field] => name [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => username [Field] => username [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => steam [Field] => steam [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => xfire [Field] => xfire [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => email [Field] => email [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => games [Field] => games [1] => varchar(1000) [Type] => varchar(1000) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => why_join [Field] => why_join [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => clan_history [Field] => clan_history [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit [Field] => recruit [1] => varchar(300) [Type] => varchar(300) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => age [Field] => age [1] => int(3) [Type] => int(3) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => location [Field] => location [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => microphone [Field] => microphone [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit_style [Field] => recruit_style [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => app_status [Field] => app_status [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => division [Field] => division [1] => varchar(150) [Type] => varchar(150) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 In your original code, replace this line $app_application = mysql_query("INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip) VALUES('$application_id', '$site_id', '$timestamp', '$_POST[name]', '$_POST[i_name]', '$_POST[username]', '$_POST[steam]', '$_POST[xfire]', '$_POST[email]', '$_POST[games]', '$_POST[why_join]', '$_POST[age]', '$_POST[location]', '$_POST[microphone]', '$_POST[recruit_style]', '$_POST[clan_history]', '$_POST[recruit]', '$_POST[userIP]') ", $recruit_link) or die(mysql_error()); With this $sql = "INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip) VALUES('$application_id', '$site_id', '$timestamp', '$_POST[name]', '$_POST[i_name]', '$_POST[username]', '$_POST[steam]', '$_POST[xfire]', '$_POST[email]', '$_POST[games]', '$_POST[why_join]', '$_POST[age]', '$_POST[location]', '$_POST[microphone]', '$_POST[recruit_style]', '$_POST[clan_history]', '$_POST[recruit]', '$_POST[userIP]') "; echo $sql; die(); What gets output? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Has it exceeded the max value for a signed int? It shouldn't be. The random number is limited to 6 characters. Is the max INT not 2147483647 (10 characters)? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 Has it exceeded the max value for a signed int? It shouldn't be. The random number is limited to 6 characters. Is the max INT not 2147483647 (10 characters)? I can't tell from your screenshot which it is, but one of the columns is much larger than 6. Since you said it randomly stopped working, my first guess is a column is at it's maximum. It's clearly not the one that's 6 tho Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 In your original code, replace this line $app_application = mysql_query("INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip) VALUES('$application_id', '$site_id', '$timestamp', '$_POST[name]', '$_POST[i_name]', '$_POST[username]', '$_POST[steam]', '$_POST[xfire]', '$_POST[email]', '$_POST[games]', '$_POST[why_join]', '$_POST[age]', '$_POST[location]', '$_POST[microphone]', '$_POST[recruit_style]', '$_POST[clan_history]', '$_POST[recruit]', '$_POST[userIP]') ", $recruit_link) or die(mysql_error()); With this $sql = "INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip) VALUES('$application_id', '$site_id', '$timestamp', '$_POST[name]', '$_POST[i_name]', '$_POST[username]', '$_POST[steam]', '$_POST[xfire]', '$_POST[email]', '$_POST[games]', '$_POST[why_join]', '$_POST[age]', '$_POST[location]', '$_POST[microphone]', '$_POST[recruit_style]', '$_POST[clan_history]', '$_POST[recruit]', '$_POST[userIP]') "; echo $sql; die(); What gets output? INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip) VALUES('3315', '3', '1344286825', 'Doc20', 'Doc', 'Doc', 'steam', 'xfire', 'test@test.com', 'games', 'why', '21', 'USA', '2', '1', 'history', 'C33Z', 'x.x.x.x') Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 There is nothing wrong, I just created few minutes ago the same table and that's correct result: Array ( [0] => u_id [Field] => u_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => PRI [Key] => PRI [4] => [Default] => [5] => auto_increment [Extra] => auto_increment ) Array ( [0] => id [Field] => id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => site_id [Field] => site_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => timestamp [Field] => timestamp [1] => int(55) [Type] => int(55) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => ip [Field] => ip [1] => varchar(100) [Type] => varchar(100) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => name [Field] => name [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => username [Field] => username [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => steam [Field] => steam [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => xfire [Field] => xfire [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => email [Field] => email [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => games [Field] => games [1] => varchar(1000) [Type] => varchar(1000) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => why_join [Field] => why_join [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => clan_history [Field] => clan_history [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit [Field] => recruit [1] => varchar(300) [Type] => varchar(300) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => age [Field] => age [1] => int(3) [Type] => int(3) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => location [Field] => location [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => microphone [Field] => microphone [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit_style [Field] => recruit_style [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => app_status [Field] => app_status [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => division [Field] => division [1] => varchar(150) [Type] => varchar(150) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) I'm beyond stumped. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 For one, your table doesn't have the column c_name so it should fail there. Secondly age is an int and you're inserting a string. '21' != 21 when it comes to SQL. Same for the other ints. Copy and paste that query directly into phpMyAdmin. Does it give you an error now? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 For one, your table doesn't have the column c_name so it should fail there. Secondly age is an int and you're inserting a string. '21' != 21 when it comes to SQL. Same for the other ints. Copy and paste that query directly into phpMyAdmin. Does it give you an error now? Well... It's now working again. It was the missing column that threw it for a loop. It would have been nice if the error was output from the start =/ I can't believe it was something that simple.. Especially after when I checked, double and triple checked my columns to make sure the names I had in the code matched/existed.. Thanks to Jesirose and Jazzman1 for working through all the possibilities. Also the int columns, the number 21 is all that is inserted. The ' ' do not follow it. Those are just in the VALUES section of that statement. I guess the statement would execute without those, but I kind of like them there I suppose. Thanks for all the help! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 6, 2012 Share Posted August 6, 2012 Here's something that will probably help with the 'no errors reported' condition. Since you have two database connections, you MUST use the appropriate link identifier in the mysql_error(.....) statements so that you will get errors that were generated on the same link that the mysql_query statement is using. For the same reason you are putting the link identifier into the mysql_query statement, you must put it into the corresponding mysql_error statements. What you are getting now, with no link identifier being used in the mysql_error() statements, is the mysql_error, if any, that occurred on the last link that was opened, which would be the $webspell_db connection. Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Here's something that will probably help with the 'no errors reported' condition. Since you have two database connections, you MUST use the appropriate link identifier in the mysql_error(.....) statements so that you will get errors that were generated on the same link that the mysql_query statement is using. For the same reason you are putting the link identifier into the mysql_query statement, you must put it into the corresponding mysql_error statements. What you are getting now, with no link identifier being used in the mysql_error() statements, is the mysql_error, if any, that occurred on the last link that was opened, which would be the $webspell_db connection. Duly noted! Thanks Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 @ PFMaBiSmAd, how do you explain this output. I was a little confused from that -> http://forums.phpfreaks.com/index.php?topic=363469.msg1720664#msg1720664 Thank you jazzman 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.