webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
795 stars 272 forks source link

editablegrid with postgresql #94

Closed bionhan closed 9 years ago

bionhan commented 9 years ago

Thanks a lot for this great work.

I would like to use editablegrid with PostGreSQL so I've begun to change the "loaddata.php" file :

//connection
$db_connexion = pg_connect("host=192.168.9.130 port=5432 dbname=nhan_db user=nhan password=1234");

//query
$result = pg_query($db_connexion,'SELECT * FROM demo');

But it doesn't work... Is it because "$result" has to be a mysqli result ?

Best regards,

Nhan

jybeaujean commented 9 years ago

You have to transform $result in an array before pass it to renderJSON. Perhaps try : pg-fetch-all ? http://php.net/manual/fr/function.pg-fetch-all.php Like this :

$grid->renderJSON(pg_fetch_all($result)) ;

bionhan commented 9 years ago

Thanks a lot for your quick answer ! It worked :)

khomsun commented 9 years ago

editablegrid with mssql 2000 help me please.

jybeaujean commented 9 years ago

I don't know mssql. Perhaps you should read the doc : http://php.net/manual/fr/book.mssql.php