rlramsey Posted July 8, 2011 Share Posted July 8, 2011 Ok, this is a weird one. I'm using: - RH AS 4 - mysql 4.1.22 - php 4.3.9 insert into applicants(appdate, appid,firstname,middlename,familyname,legalname,dob,gender,uscitizen,uilaw,uihawkid,uidnumber,lawschool,email,cellphone,homephone,curraddr1,curraddr2,curraddr3,currcity,currstate,currpostalcode,currcountry,permaddr1,permaddr2,permaddr3,permcity,permstate,permpostalcode,permcountry,contactname,contactrelationship,contactaddr1,contactaddr2,contactaddr3,contactcity,contactstate,contactpostalcode,contactcountry,contactphone,contactemail,whichapp) values (now(), '7FE00481-4EF3-1552-BB34-92D0D56CE785','B','l','r','adsf','2011-07-05','male','','yes','rramsey','456123','','[email protected]','312 456 7890','','1','2','3','r','ia','45612','USA','','','','','','','USA','d','w','1','23','3','','','','USA','','','l') - mysql_error() is Unknown column 'whichapp' in 'field list' - mysql_errno() is 1054 - create table is CREATE TABLE `applicants` ( `appdate` datetime NOT NULL default '0000-00-00 00:00:00', `appid` varchar(255) NOT NULL default '', `familyname` varchar(255) NOT NULL default '', `firstname` varchar(255) NOT NULL default '', `middlename` varchar(255) NOT NULL default '', `legalname` varchar(255) NOT NULL default '', `dob` date NOT NULL default '0000-00-00', `curraddr1` varchar(100) NOT NULL default '', `curraddr2` varchar(100) NOT NULL default '', `curraddr3` varchar(100) NOT NULL default '', `currstate` varchar(100) NOT NULL default '', `currcity` varchar(100) NOT NULL default '', `currcountry` varchar(100) NOT NULL default '', `currpostalcode` varchar(100) NOT NULL default '', `cellphone` varchar(100) NOT NULL default '', `homephone` varchar(100) NOT NULL default '', `uistudent` enum('y','n') NOT NULL default 'y', `uihawkid` varchar(100) NOT NULL default '', `email` varchar(100) NOT NULL default '', `permaddr1` varchar(100) NOT NULL default '', `permaddr2` varchar(100) NOT NULL default '', `permaddr3` varchar(100) NOT NULL default '', `permstate` varchar(100) NOT NULL default '', `permcity` varchar(100) NOT NULL default '', `permcountry` varchar(100) NOT NULL default '', `permpostalcode` varchar(100) NOT NULL default '', `contactname` varchar(100) NOT NULL default '', `contactaddr1` varchar(100) NOT NULL default '', `contactaddr2` varchar(100) NOT NULL default '', `contactaddr3` varchar(100) NOT NULL default '', `contactstate` varchar(100) NOT NULL default '', `contactcity` varchar(100) NOT NULL default '', `contactcountry` varchar(100) NOT NULL default '', `contactpostalcode` varchar(100) NOT NULL default '', `contactphone` varchar(100) NOT NULL default '', `contactemail` varchar(100) NOT NULL default '', `contactrelationship` varchar(100) NOT NULL default '', `uilaw` enum('y','n') NOT NULL default 'y', `lawschool` varchar(100) NOT NULL default '', `uidnumber` varchar(100) NOT NULL default '', `lawyear` varchar(100) NOT NULL default '', `gender` varchar(100) NOT NULL default '', `whichapp` varchar(100) NOT NULL default '', `uscitizen` enum('y','n','blank') NOT NULL default 'blank', PRIMARY KEY (`appid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 I'm trying to just insert the data. If I copy and paste the insert query into either Mysql Control Center or the mysql command line, it inserts with no problem. The other puzzling thing is that if I simply do a select * from applicants in mysqlcc then I get: [www.law.uiowa.edu] ERROR 1104: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay But if I do the same select query from the command line, it works just fine. Here's the result of explain select * from applicants: +----+-------------+------------+--------+---------------+--------+---------+--------+--------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+--------+---------------+--------+---------+--------+--------+-------+ | 1 | SIMPLE | applicants | ALL | [NULL] | [NULL] | [NULL] | [NULL] | 3 | | +----+-------------+------------+--------+---------------+--------+---------+--------+--------+-------+ Whew. I think I've got all of the info in the posting instructions. So I'm just extremely puzzled by this one. Yes, I know mysql and php 4 are old, but they are what RedHat AS 4 supports. We're moving to RH 6 server in a few months, but I still need this to work now. Any ideas? Thanks, Bob Link to comment https://forums.phpfreaks.com/topic/241412-insert-works-from-commandline-but-not-php/ Share on other sites More sharing options...
fenway Posted July 8, 2011 Share Posted July 8, 2011 Regarding the insert-- that's impossible -- you must be querying a different DB. Run a DESCRIBE to confirm. Regarding the select -- that must be imposed by your PHP driver. Link to comment https://forums.phpfreaks.com/topic/241412-insert-works-from-commandline-but-not-php/#findComment-1240079 Share on other sites More sharing options...
AyKay47 Posted July 8, 2011 Share Posted July 8, 2011 why are you using PHP4!? Link to comment https://forums.phpfreaks.com/topic/241412-insert-works-from-commandline-but-not-php/#findComment-1240085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.