Good Day, Guys..
I am encountering a problem with my query.. I have a 14 columns in my database and it has 4 data on it. I query it and display it to datagrid my problem was
in the datagrid it doesn't return the 4 rows of my database supposed to be it will return the 4 rows. I attached the screen shot.
Any help is very much appreciated.
my script
---------------
put revOpenDatabase("mysql","sql5.freemysqlhosting.net","sql542966","sql542966","sG4!dS3!") into conn1
put "select * from temptransaction" into query
put revDataFromQuery(,,conn1,query) into dt
set the dgText of group "Datagrid 1" to dt
revCloseDatabase conn1
put empty into conn1
------------------
Thank You, Livecoders..
Regards
-snop21
Help query displaying in datagrid..
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Help query displaying in datagrid..
Hi snop21,
From the lesson http://lessons.runrev.com/m/datagrid/l/ ... -with-data
Is that enough?
Simon
From the lesson http://lessons.runrev.com/m/datagrid/l/ ... -with-data
You dropped the columnDelim rowDelim from revDataFromQuery.pText is assumed to be a collection of data where each row is delimited by the return character and each item is delimited by a tab.
Is that enough?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Help query displaying in datagrid..
I would say : your data contains CR and/or LF.
With
LiveCode will use (per default) tab as column delimiter and return (CR) as row delimiter.
So if one of your column contains a CR, LiveCode will see "new row". Hence the twisted display.
Solution :
-clean the data you record in your database, by removing CR etc.
-or :
With
Code: Select all
put revDataFromQuery(,,conn1,query) into dt
So if one of your column contains a CR, LiveCode will see "new row". Hence the twisted display.
Solution :
-clean the data you record in your database, by removing CR etc.
-or :
Code: Select all
put revDataFromQuery(,"|",conn1,query) into dt
replace CR with " " in dt
replace LF with " " in dt
replace "|" with CR in dt
set the dgText of group "Datagrid 1" to dt