|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
Table Generation from the Database In addition to wide range of useful features CodeThatTable allows you to generate table script from the database. At the example below we use MySQL as database platform and PHP as web-script language. But you can choose your own favorite database platform and web-script language. Here we just try to show basic principles for database table generation. First of all we create two tables - test_structure - specify colunms structure and test_data - data set. Table structure and data are listed below:
Of course, when you create your real CodeThatTable script, tables will contain more fields and data. Next step - we create .php script. Result of this script implementation may be script file or separated content file.
And finally we complete a web page for menu script:
Example - Table Generation from the DatabaseYou can see an example and complete code here - Table Generation from the Database Example [popup] Table Generation from the Form To load data from the form you should use
method. Such a method is quite handy to use when you're working with csv string or xml string data types. At the time you're working with csv string there is no need to replace Enter by \n. For example:
Example - Table Generation from the formYou can see an example and complete code here - Table Generation from the form [popup] Table Generation from the CSV File To define data from the csv file set:
and at the data parameter set a path to your csv file. For example:
It's handy to use data loading from file when it's impossible to form content from server dynamically. This method is also useful when you'd like to decrease server load, because it's faster to load complete file that form it before. Important! If your brower don't support ActiveXObject or XMLHttpRequest, popup window will be used to get content from file. If you have troubles with loading data from external file, allow please your browser open popup windows.Example - Table Generation from the CSV fileYou can see an example and complete code here - Table Generation from the CSV file [popup] Table Generation from the Csv StringYou also can define data from the csv data strings at csv format by using strings like this:
where Enteris changed by \n. Also you should specify
Example - Table Generation from the CSV stringYou can see an example and complete code here - Table Generation from the CSV string [popup] Table Generation from the XML FileTo define data from the XML file set:
and at the data parameter set a path to your xml file. For example:
This format allows to store file formatting. XML-file format is:
Important! If your brower don't support ActiveXObject or XMLHttpRequest, popup window will be used to get content from file. If you have troubles with loading data from external file, allow please your browser open popup windows.Example - Table Generation from the XML fileYou can see an example and complete code here - Table Generation from the XML file [popup] Table Generation from the XML StringTo define data from the XML string set:
and at the data parameter write data string. Each Enter should be replaced by '\n'. This format allows to store formatting. |
||||||||||||||||||||||
|
||||||||||||||||||||||
© CodeThat.com, 2003-2008 |
||||||||||||||||||||||