Results 1 to 6 of 6

Thread: what does this line of code mean?

  1. #1

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    what does this line of code mean?

    PHP Code:
    return ( $row $db->sql_fetchrow($result) ) ? $row false
    I don't know the meanings of -> , ? , : in this line of code. Also can you please explain what $this means while you are at it?

    Thanks in advance

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: what does this line of code mean?

    Its php's IIf decision structure function.
    If there is a record returned from the resultset then reutn the row otherwise return False
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: what does this line of code mean?

    the -> is used in classes to call a function.

    $db is a class and sql_fetchrow() is a function.

    $db->sql_fetchrow() calls the function.
    My usual boring signature: Something

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: what does this line of code mean?

    In a non-static member of a class, $this points to the current instance of the class.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: what does this line of code mean?

    Quote Originally Posted by kill_bill_gates
    PHP Code:
    return ( $row $db->sql_fetchrow($result) ) ? $row false
    I don't know the meanings of -> , ? , : in this line of code. Also can you please explain what $this means while you are at it?

    Thanks in advance
    Return the value after comparison (?) of $row when $row, after execution of the member function (->) sql_fetchrow of the $db object instance, passing this function a copy of the data stored in $result; is a non null, non zero or a string containing 1 or more characters. Return false (: ) if it is zero, a zero length string or null.
    Last edited by visualAd; Jul 1st, 2008 at 04:24 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: what does this line of code mean?

    always better when it is explained 4 times
    My usual boring signature: Something

Posting Permissions

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



Click Here to Expand Forum to Full Width