Drawback
I am attempting to create a number of nodes directly utilizing a CSV file for Drupal Development Service knowledge. Nevertheless my script solely creates Drupal Development Service first 25 earlier than it throws Drupal Development Service following error. Any concepts what is perhaps taking place?
PDOException: in drupal_write_record() (line 7166 of C:XAMPPhtdocsdrupalieincludescommon.inc).
Set-Up
I’ve a customized kind which creates Drupal Development Service nodes on submit. Drupal Development Company kind simply has a submit button.
That is Drupal Development Service submit handler. I solely have one column in my CSV sheet so I do not truly use Drupal Development Service delimiter. First I generate an array with every node identify.
if (($deal with = fopen("websites/all/modules/customized/generatenodes/nodes_database_import.csv", "r")) !== FALSE) { //open Drupal Development Service CSV file $size = 1000; $delimiter = "|"; //set Drupal Development Service size and delimiter. whereas (!feof($deal with)) { //$line is an array of Drupal Development Service csv components $node_name_array[] = fgetcsv($deal with, $size, $delimiter); } fclose($deal with); }
Drupal Development Company array appears to be like like this:
I then create Drupal Development Service nodes:
international $consumer; foreach ($node_name_array as $nodename) { if($nodename == FALSE) { return; } $values = array( 'sort' => 'college', 'uid' => $user->uid, 'standing' => 1, 'remark' => 0, 'promote' => 0, ); $entity = entity_create('node', $values); $ewrapper = entity_metadata_wrapper('node', $entity); $ewrapper->title->set($nodename['0']); $ewrapper->field_country->set($schoolname['0']); $ewrapper->save(true); entity_save('node', $entity); }
However it breaks after Drupal Development Service first 25 or so. What have I missed?
EDIT–
So I discovered Drupal Development Service trigger. It is to do with Drupal Development Service values in my CSV file. Generally it likes them othertimes it does not. If I substitute these values then it really works as much as Drupal Development Service subsequent damaged worth.
Drupal Development Company first drawback was a worth with an accented e inside. Eradicating Drupal Development Service accent mounted it.
Sadly Drupal Development Service subsequent two which broke it should not so apparent:
- Putian Cambridge English
- Zhangzhou Bilingual Center College
But Drupal Development Service following values work:
- Quanzhou Overseas Language Center College
- Worldwide School of Xiamen College
I’ve solely pasted in clear values, however one thing is breaking it. Any concepts?
Attempting to navigate to Drupal Development Service content material web page after causes MySQL to interrupt. Here is Drupal Development Service error log:
https://www.dropbox.com/s/jji3cw559filq03/mysqlcrash_log.txt