$dbh->getOne($query, $params = array())

Author Topic: $dbh->getOne($query, $params = array())  (Read 799 times)

Offline beingchinmayTopic starter

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 1
  • Posts: 73
  • Karma: 0
  • Gender: Male
  • I am Chinmay
    • Fat Cutter
$dbh->getOne($query, $params = array())
« on: 08-11-2016, 07:22:02 »
The getOne() method returns the first column from the first row of data. Use the $params parameter if $query contains placeholders (this applies to the rest of the convenience functions, too). Here’s an exampl

Quote
$name = $dbh->getOne('SELECT name FROM users WHERE id = ?',
array($_GET['userid']));


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1551 Views
Last post 10-10-2011, 03:31:57
by manvbf
0 Replies
721 Views
Last post 12-21-2015, 02:27:50
by chinmay.sahoo
1 Replies
1413 Views
Last post 05-30-2016, 21:09:23
by ngomaichi
0 Replies
854 Views
Last post 08-11-2016, 07:09:13
by beingchinmay
0 Replies
635 Views
Last post 09-23-2016, 06:19:03
by beingchinmay