+ Reply to Thread
Results 1 to 3 of 3

Thread: DB layer?

  1. #1
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    DB layer?

    I am working on a script that can be installed on different db system, so they are using dblayer (i'm not sure if this is something they made up or is somewhat known) but it doesn't have "mysql_fetch_field" and i need to add it in there;

    http://us2.php.net/mysql_fetch_field
    PHP Code:
        function fetch_field($query_id 0
        {
            return (
    $query_id) ? @mysql_fetch_field($query_id) : false;
        } 
    that is so far what i have done, but I am missing the second argument, the $field_offset, can somebody help me fix that?

  2. #2
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: DB layer?

    is this for SOD?

    Quote Originally Posted by http://us2.php.net/mysql_fetch_field
    field_offset

    The numerical field offset. If the field offset is not specified, the next field that was not yet retrieved by this function is retrieved. The field_offset starts at 0.
    try this code:
    PHP Code:
    function fetch_field($query_id 0$field_offset NULL
        {
            return (
    $query_id) ? @mysql_fetch_field($query_id$field_offset) : false;
        } 
    that should make it so if you don't pass a second variable to fetch_field, then it should act like there's no second value, but if you do pass a number, then it would work that way too.

    the return line is actually an if else conditional. since query id = 0 by default, if there's nothing sent, it will return false in the conditional, thus not executing the mysql function.


    Remember, if this works for you, then please add REP. It's not hard ;)
    Last edited by xPlozion; 12-31-2008 at 11:21 AM.

  3. #3
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: DB layer?

    yes it is for SOD, and let me look into what you said, I tried it but it didn't work; but I might have been careless

+ Reply to Thread

Similar Threads

  1. add layer over active content
    By allinone in forum Programming Help
    Replies: 2
    Last Post: 11-02-2008, 07:30 AM
  2. Logo Creation tutorials
    By alan1987 in forum Tutorials
    Replies: 4
    Last Post: 10-14-2007, 08:50 PM
  3. PEAR database program abstraction layer?
    By lambada in forum Free Hosting
    Replies: 10
    Last Post: 09-06-2006, 07:05 PM
  4. Photoshop Tutorials
    By Cambridge in forum Tutorials
    Replies: 9
    Last Post: 10-02-2005, 09:16 AM
  5. |PS|*Blur text Tutorial*
    By |Born2Shoot| in forum Tutorials
    Replies: 7
    Last Post: 06-04-2005, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers