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

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

Offline beingchinmayTopic starter

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 48
  • 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
1374 Views
Last post 10-10-2011, 03:31:57
by manvbf
0 Replies
571 Views
Last post 12-21-2015, 02:27:50
by chinmay.sahoo
1 Replies
974 Views
Last post 05-30-2016, 21:09:23
by ngomaichi
0 Replies
423 Views
Last post 08-11-2016, 07:09:13
by beingchinmay
0 Replies
419 Views
Last post 09-23-2016, 06:19:03
by beingchinmay