Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 199

Drupal provides a standard, vendor-agnostic abstraction layer for accessing database servers.

0
votes
The first error is caused from the fact that Drupal 7 doesn't define db_result() anymore; it was used from Drupal 6. The second error is caused from $query->execute() returning an object of that clas …
answered Nov 16 '15 by kiamlaluno
2
votes
As reported in DatabaseSchema_pgsql::changeField, and in db_change_field(): IMPORTANT NOTE: To maintain database portability, you have to explicitly recreate all indices and primary keys that are … any other issue you could have with database indexes. About adding an index to a database table that is created from another module, I would not suggest doing that, because: A module doesn't drop …
answered Jun 7 '11 by kiamlaluno
2
votes
For that function to be available from outside Drupal, you need to first bootstrap Drupal. This means that, with Drupal 7, the first lines of enquiry.php needs to be the following ones. define('DRUPA …
answered Mar 13 '13 by kiamlaluno
3
votes
As made evident in Compare db_query() and db_select() performance, db_query() is faster than db_select(), which should then be used when you need to make the query you are executing alterable from oth …
answered Mar 24 '17 by kiamlaluno
6
votes
2answers
Looking at Drupal code, I notice that sometimes a query is being executed using array('target' => 'slave') as options, and I don't understand in which case that should be done. I thought it was done …
asked Oct 4 '12 by kiamlaluno
1
vote
$result = db_query("SELECT nid FROM {node}"); foreach ($result as $record) { dsm($record->nid); } The database API functions will replace the curly brackets with the string set as table prefix in settings.php. …
answered Jul 7 '11 by kiamlaluno
0
votes
A field that is not defined as unique key or primary key is allowed to have the same value in different records of that database table. So, if you don't want to have the same value of aid in two …
answered Apr 27 '14 by kiamlaluno
4
votes
Your form submission handler should take the submitted values from $form_state['values'], not $form. The node object is then available in $form_state['node']. For such task it would be better to im …
answered Oct 25 '12 by kiamlaluno
1
vote
Drupal.org API shows which file contains a Drupal function, class, or method for which you are looking the documentation. In the case of db_query(), this is what the site shows. That is also a link …
answered Apr 8 '13 by kiamlaluno
0
votes
If you need the last insert ID, after you executed an INSERT with the InsertQuery class, InsertQuery::execute() returns that value. The last insert ID of the query, if one exists. If the query was …
answered Jan 30 '13 by kiamlaluno
2
votes
also manually remove the database table, but if the information about that table is still contained in information_schema.tables, DatabaseSchema::createTable() will raise an exception. …
answered Aug 23 '12 by kiamlaluno
1
vote
The error message is about the schema currently used by the module, which defines the primary key using the following code. function jquery_file_upload_schema() { $schema['jquery_file_upload'] = ar …
answered Oct 21 '12 by kiamlaluno
1
vote
You could also use the following code. $select = db_select('my_values', 'v') ->condition('datetime', '2012-12-15 00:00:00', '>') ->condition('datetime', '2013-01-01 00:00:00', '<') ->orderBy('d …
answered Jan 15 '13 by kiamlaluno
5
votes
@MEsch is right about the method to call, but I would rather write the code as the following. $query = db_select('taxonomy_term_data', 't') ->fields('t', array('tid', 'name', 'description')); $ali …
answered Dec 31 '12 by kiamlaluno
1
vote
Since you are querying some tables to get the value of an entity field, I would rather use the EntityFieldQuery class. To answer your question, what you want to achieve can be obtained by concatenati …
answered Jul 14 '15 by kiamlaluno

15 30 50 per page