addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Message boards will no longer be available after July 18, 2024.

We recommend saving any important information beforehand. Going forward, you can stay connected with your groups using the Discussions feature (we'll be rolling out some exciting updates soon)!

Learn more about the upcoming changes in this article;

Re: [php-49] Need a dropdown in handsontable.

From: Ramesh K
Sent on: Monday, July 25, 2016, 10:21 AM

How can I use this in handsontable sir.?

On Jul 25,[masked]:44 PM, "Andrew" <[address removed]> wrote:
Hey Ramesh,

Each framework (WordPress vs Laravel vs Zend ) has it's own way of connecting to databases and running queries. Here is a simple way to do it outside of a framework. 

For the following code to work, you'll need to create a couple of define() statements for DSN, DB_USER, DB_PASS

//

class RameshApp {

    /** PDO database connection  */
    protected $dbh;

    public function __construct( PDO $db ) {
        $this->dbh = $db;
    }

    public function getStudentNames() {
        $sql = "SELECT id, first_name, last_name FROM student";

        $sth = $this->dbh->prepare( $sql );
        $sth->execute();

        $result = $sth->fetchAll();

        return $result;
    }
}


$pdo = new PDO( DSN, DB_USER, DB_PASS );

$app = new RameshApp( $pdo );
$names = $app->getStudentNames();

print_r( $names );



#
# Andrew Woods
# Seattle, WA
# http://andrewwoods.net
#
#    "With each sunrise, we start anew"
#


On Mon, Jul 25, 2016 at 8:31 AM, Ramesh K <[address removed]> wrote:

how can i show a dropdown in handsontable with values already stored in database.

for example, am having a certain students name in db. now want to show all student name in dropdown which is saved in db using class.

please help...am just a beginner





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of Ramesh K from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of Andrew from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

People in this
group are also in: