06-15-2009
52,
0
Join Date: Dec 2008
Last Activity: 25 February 2010, 3:53 AM EST
Posts: 52
Thanks Given: 0
Thanked 0 Times in 0 Posts
Thanks. I got the information from INFORMATION_SCHEMA COLUMNS.
While retrieving the data from the result of query I faced following problem.
mysql> select select COLUMN_NAME, DATA_TYPE, IS_NULLABLE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION from INFORMATION_SCHEMA.COLUMNS where table_name='account');
In coding I run the query using mysql_real_query() whose result is stored in
pResult = mysql_store_result(pMySQLDB);
fields = mysql_fetch_field(pResult);
my_ulonglong noOfRows = mysql_num_rows(pResult);
row = mysql_fetch_row(pResult);
it will not return any rows.
But in fields I get select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION that I don't want.
I want the value of these field like "amit, "MY_VAR_STRING", '10', '0'.
I want to store these data inot another variable however not getting it.
Can you please tell me how do I fetch the data what I want from the query output or I am doing anything wrong?