SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    adodb Database Description to XML Schema

    Just wondering if anyone has any experience of adodb, in particular how good it is as describing databases, such as the data type of a column.

    Using the MySQL functions, you have mysql_fetch_field() which returns an object describing the column.

    The reason why? Well been toying with XML Schemas and was wondering idily; "How hard would it be to examine a table or database and create an XML schema from it?"

    Once you have a schema from a database, you have something to generate things like HTML forms on the fly, with the help of a little XSL. You also have a basis for building a navigation system for your data, generating XML from the queries, slapping XSL over the top.

    All it would take is a cunning mechanism for defining XSL Templates (any ideas?) and PHP will rule the world! mwhuhahaahahahaha!
    Attached Images Attached Images

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've used ADODB ( in ASP )...
    it's database describing functionality is bit over-complicated.

    for example, when you get the type of a column, it gives you a number, that is part of the adTypeEnum. there is a number for every possible datatype. you can find the constants in adodb.inc, that comes with ASP ( I have no idea where to find that now )
    Web Hound
    $x='010000010110001101101001011001000101001001100101011010010110011101101110';
    for($i=0;$i<strlen($x);$i+=8)print(chr(bindec(substr($x,$i,8))));

  3. #3
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    check this out

    you've probably looked at this...

    but check this out: http://php.weblogs.com/adodb_manual#fetchfield

    This method can let you check the data type of a field

  4. #4
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for tip off Actually hadn't seen that - haven't done much with adodb before and trawling the docs could find that anywhere.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •