joecalis 0 Posted June 30, 2014 (edited) I was just wondering what the outcome will be if I do the following: query_sql("SELECT * FROM `awesome_table` WHERE `ID`=1",.@tempvar$); awesome_table: ID Name Val1 Val2 Val3 (int) (string) (int) (int) (int) 1 Hi 0 1 0 2 Hello 1 1 1 My question is, would it automatically store all the information in the row selected into the array like so: .@tempvar$[0] = 1 .@tempvar$[1] = "Hi" .@tempvar$[2] = 0 .@tempvar$[3] = 1 .@tempvar$[4] = 0 or would it only store the first value in the row? also would it automatically store the "int" values as "string"? Need reply fast please and thank you Edited June 30, 2014 by joecalis Quote Share this post Link to post Share on other sites
0 Sunzuki 1 Posted June 30, 2014 (edited) no it wouldn't. if it would work it would be .@tempvar$[0] = 1 .@tempvar$[1] = 2 you have to add more variables to the end. query_sql("SELECT * FROM `awesome_table` WHERE `ID`=1", .@ID, .@Name$, .@val1, .@val2, .@val3); .@ID[0] = 1; .@Name$[0] = Hi .@ID[1] = 2; .@Name$[0] = Hello basically you just put the columns (from after select, * = all) in the second part of the query_sql command $ because it is a string not an integer Edited June 30, 2014 by Sunzuki Quote Share this post Link to post Share on other sites
0 joecalis 0 Posted June 30, 2014 no it wouldn't. if it would work it would be .@tempvar$[0] = 1 .@tempvar$[1] = 2 you have to add more variables to the end. query_sql("SELECT * FROM `awesome_table` WHERE `ID`=1", .@ID, .@Name$, .@val1, .@val2, .@val3); .@ID[0] = 1; .@Name$[0] = Hi .@ID[1] = 2; .@Name$[0] = Hello basically you just put the columns (from after select, * = all) in the second part of the query_sql command $ because it is a string not an integer Thank you, just as I expected it would do that. But now I have alot to do, because I have like 25 columns to copy. Quote Share this post Link to post Share on other sites
0 Sunzuki 1 Posted July 1, 2014 You could use sql command: "SHOW COLUMNS FROM sometable" Quote Share this post Link to post Share on other sites
0 joecalis 0 Posted July 1, 2014 You could use sql command: "SHOW COLUMNS FROM sometable" But can I get the data from the columns selected and store it in an array? Quote Share this post Link to post Share on other sites
I was just wondering what the outcome will be if I do the following:
awesome_table:
ID Name Val1 Val2 Val3
(int) (string) (int) (int) (int)
1 Hi 0 1 0
2 Hello 1 1 1
My question is, would it automatically store all the information in the row selected into the array like so:
.@tempvar$[0] = 1
.@tempvar$[1] = "Hi"
.@tempvar$[2] = 0
.@tempvar$[3] = 1
.@tempvar$[4] = 0
or would it only store the first value in the row?
also would it automatically store the "int" values as "string"?
Need reply fast please and thank you
Edited by joecalisShare this post
Link to post
Share on other sites