SELECT * FROM data
drupal>>db_select('data','d')
->fields('d')
->execute()
->fetchAll()
SELECT * FROM data WHERE name = 'Lady Gaga'
drupal>> db_select('data','d')
->fields('d')
->condition('name','Lady Gaga')
->execute()
->fetchAll()
SELECT * FROM data WHERE age >= 30
drupal>> $query = db_select('data','d')->fields('d')->condition('age',30,'>=')->execute()->fetchAll()
SELECT * FROM data WHERE age >=30 OR name = 'Lady Gaga'
drupal>> db_select('data','d')->fields('d')
->condition(db_or()
->condition('age',30,'>=')
->condition('name','Lady Gaga'))
->execute()
->fetchAll();
SELECT * FROM data WHERE age>=30 AND id>5
drupal>> db_select('data','d')->fields('d')->condition(db_and()->
No comments:
Post a Comment