Getting structure of resultset in memory
After a SELECT query is executed, there is a resultset located in memory.
Without using 3rd-party software, is there a way to "capture" the "table structure" of the resultset into a text file for later reference?
Thanks for any help...
I do not really know of a way to get the structure of a recordset, but you can get the structure of the tables involved by using the SHOW COLUMNS syntax from MySQL:
This script will output something like this:
I just thought of another way, but it would require that a result came back from your query. You could dump the first row of the result into an array using mysql_fetch_assoc and get the keys from the array using array_keys like this:
This would dump the key names of $row into an array that you could parse.
Thanks so much for your replies. They are most helpful for me (a learner) on a number of levels...First, there are several new bits of code that I have not encountered previously (e.g., ".=" -- not easy for me to grasp, but I think I've gotten to "second grade" on it now). Secondly, the overall concept, though simple to you, is new to me and I've gone through everything step-by-step.
So I'm still at work on this -- just wanted to say thanks for now.
|All times are GMT. The time now is 03:54 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0