Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. arr_fields[]: a bigint
  2. arr_fields[]: b bit
  3.  
  4. $fields = array(
  5. 'a' => array(
  6. 'type' => 'bigint',
  7. ),
  8. 'b' => array(
  9. 'type' => 'bit',
  10. )
  11. );
  12.  
  13. $schema = array(
  14. 'description' => t ('Contains a particular templates data inputted from the MyID Inputting System'),
  15. 'fields' => $fields,
  16. );
  17.  
  18. db_create_table('myid_template_' . $template_id, $schema);
  19.  
  20. foreach ($arr_fields as $value) {
  21. $arr = explode(' ' , $value);
  22. $fields[$arr[0]] = array('type' => $arr[1]);
  23. }
  24.  
  25. $schema = array(
  26. 'description' => t ('Contains a particular templates data inputted from the MyID Inputting System'),
  27. 'fields' => $fields,
  28. );
  29.  
  30. db_create_table('myid_template_' . $template_id, $schema);
  31.  
  32. <em class="placeholder">PDOException</em>: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input
  33. LINE 4: )
  34. ^: CREATE TABLE {myid_template_489} (
  35. a ,
  36. b
  37. ); Array
  38. (
  39. )
  40. in <em class="placeholder">db_create_table()</em> (line <em class="placeholder">2720</em> of <em class="placeholder">C:xampphtdocsdrupal-7.34includesdatabasedatabase.inc</em>).
  41.  
  42. foreach ($arr_fields as $value) {
  43. $arr = explode(' ' , $value);
  44. $fields[$arr[0]] = array('type' => $arr[1]);
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement