Codeigniter Error Number 1136
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more error number 1054 in codeigniter about Stack Overflow the company Business Learn more about hiring developers or posting ads error number 1146 in codeigniter with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Error Number 1064 Codeigniter
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Codeigniter Model Getting Error: Column count doesn't match value count at row
Error Number 1048 Codeigniter
2 up vote 0 down vote favorite I am parsing currency rates from a rss.xml feed that all works great. I am now trying to insert that data into a database called rates with a table called tblRates. I keep getting this error and do not know why. Here is the function in the model I am using to try to batch insert into the database. function addIQDRates($Data){ if($this->db->insert_batch('tblRates', error number 1062 codeigniter $Data, 'Currency')) { return $this->db->affected_rows(); }else{ return FALSE; } } Also here is the foreach statement I am using in my controller to sort the data from the xml file and to insert it into the database. $Data = array(); $Data = array(); $Count = 0; foreach ($xml->channel->item as $currencyInfo) { $Data[$Count]['Currency'] = trim(str_replace("/USD", "", $currencyInfo->title)); // UNIQUE $Data[$Count]['PubDate'] = date('Y-m-d H:i:s', strtotime(trim($currencyInfo->pubDate))); $Data['CXRate'] = trim(preg_replace("/[^0-9,.]/", "", str_replace("1 United States Dollar = ", "", $currencyInfo->description))); $Data[$Count]['DateCreated'] = date('Y-m-d H:i:s'); $Count++; } $TotalRows = $this->mycron_model->addIQDRates($Data); Also here is my Create Table statement CREATE TABLE IF NOT EXISTS `tblRates` ( `RateID` int(11) NOT NULL AUTO_INCREMENT, `Currency` varchar(50) NOT NULL, `PubDate` datetime NOT NULL, `CXRate` int(11) NOT NULL, `DateCreated` datetime NOT NULL, PRIMARY KEY (`RateID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; all help greatly appreciated. mysql codeigniter model share|improve this question edited Dec 6 '13 at 15:54 guness 1,90111846 asked Dec 6 '13 at 15:21 Codin 5111 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote I am not sure, you might have written $Data['CXRate'] instead of $Data[$Count]['CXRate']. So the loop should like like below: foreach ($xml->channel->item as $currencyInfo) { $Data[$Count]['Currency'] = trim(str_replace("/USD", "", $currencyInfo->title)); // UNIQUE $Data[$Count]['PubDate'] = date('Y-m-d H:i:s', strtotime(trim($currencyInfo->pubDate))); $Data[$Count]['CX
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Codeigniter Error 500
of this site About Us Learn more about Stack Overflow the company codeigniter error 404 page not found Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users codeigniter error message Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/20427509/codeigniter-model-getting-error-column-count-doesnt-match-value-count-at-row-2 minute: Sign up Error Code: 1136. Column count doesn't match value count [closed] up vote 0 down vote favorite The following query triggers this error: Error Code: 1136. Column count doesn't match value count at row 1. Why am I getting this error? SET @id_country = (SELECT id_country FROM prestashop147.ps_country WHERE iso_code = 'br'); SET @id_state = (SELECT id_state FROM ps_state WHERE http://stackoverflow.com/questions/16340072/error-code-1136-column-count-doesnt-match-value-count iso_code = 'mg'); INSERT INTO ps_address(id_address, id_country, id_state, id_customer, id_manufacturer, id_supplier, alias, company, lastname, firstname, address1, address2, postcode, city, other, phone, phone_mobile, vat_number, dni, date_add, date_upd, active, deleted) VALUES (null, @id_country, @id_state, 2, 0, 0, 'Endereço', 'sobrenome', 'nome', 'rua canada, 71', 'complemento', 'cep', 'cidade', null, 'telefone', 'celular', null, null, null, null, 1, 0); mysql insert mysql-error-1136 share|improve this question edited Sep 20 at 17:38 Tiny Giant 10.4k62045 asked May 2 '13 at 14:00 user2132073 1782316 closed as off-topic by Louis, Sherif, Cerbrus, ssube, Drew Sep 20 at 18:40 This question appears to be off-topic. The users who voted to close gave this specific reason:"This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Louis, Sherif, Cerbrus, ssube, DrewIf this question can be reworded to fit the rules in the help center, please edit the
a temp folder overwrite the existing database You're currently viewing a stripped down version of our content. View the full version with proper formatting. Pages: 1 2 3 4 http://forum.codeigniter.com/archive/index.php?thread-57525-6.html 5 6 El Forum04-08-2013, 04:43 AM [eluser]the_unforgiven[/eluser] Sorted it, realised something wasn't right with the CSV so checked it and insert 1st row to match the titles in the db http://archive-org.com/org/o/open-audit.org/2014-08-21_4450594_55/Open_AudIT_bull_View_topic_Update_error/ and it worked....Weird El Forum04-08-2013, 04:57 AM [eluser]the_unforgiven[/eluser] All working but now I need to get rid of the first line from the csv as these are titles so how can error number i incorp this into the code? El Forum04-08-2013, 05:00 AM [eluser]the_unforgiven[/eluser] Again i'm using your code not the one i edited and still shows A Database Error Occurred Error Number: 1136 Column count doesn't match value count at row 1 when i edit the csv and remove the 1st line which shows the titles like JobRef, Area, Parish, AbbrWorkType etc, so i codeigniter error number need to know how to get this working with or without the headers and also the column count error El Forum04-08-2013, 06:49 AM [eluser]TheFuzzy0ne[/eluser] You can just call: Code: fgetcsv($fh, 1000, ','); to discard the first row. As for your error. Please check the CSV for that row. There may be an extra column on the end if there's a space, which would explain the problem. You may need to add a little error checking to make sure each row has exactly the number of columns you expect it to have. El Forum04-08-2013, 06:58 AM [eluser]the_unforgiven[/eluser] I have Code: fgetcsv($fh, 1000, ','); already but it still insert the 1st row into the database which in this case is the titles. I'm totally new to all this csv uploading as you probably guessed by now, so how would one check for errors etc? El Forum04-08-2013, 07:19 AM [eluser]TheFuzzy0ne[/eluser] Make sure you're discarding the first row before you enter your loop. As for error checking, so long as you know how many columns you're expecting, you can simply check each row using count() to m
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 Total: 638Choose link from "Titles, links and description words view": Or switch to "Titles and links view". Open-AudIT • View topic - Update error device I get this error Error Number 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 system WHERE system id system system id AND AND system man status p at line 1 SELECT man type FROM system WHERE system id 260 AND system id in SELECT distinct system system id FROM system WHERE system id system system id AND AND system man status production AND timestamp system timestamp Filename models m oa group php Line Number 88 I am running version 1 1 centOS 6 5 mysql 5 1 71 and this was a fresh install I had this error right out of the box I also get an error when creating a new group although it does seem to create it I just can t populate it This error occurs when updating any field on the edit screen Top Display posts from previous All posts 1 day 7 days 2 weeks 1 month 3 months 6 months 1 year Sort by Author Post time Subject Ascending Descending Page 1 of 1 1 post Board index Open AudIT Discussion All times are UTCOriginal URL path: http://www.open-audit.org/phpBB3/viewtopic.php?p=22519 (2014-08-21)Open archived version from archive Open-AudIT :: View topic - Automatically run Open-AudIT on OSX to add the following script in usr bin openaudit and make it executeable with chmod x Code bin bash curl noproxy SERVERNAME http SERVERNAME openaudit audit osx sh bash Please edit the URL for your requirements It s also possible to place the original audit script in