|
-
Jun 30th, 2008, 04:26 PM
#1
Thread Starter
Addicted Member
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
-
Jun 30th, 2008, 05:56 PM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jun 30th, 2008, 07:25 PM
#3
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
-
Jun 30th, 2008, 08:16 PM
#4
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.
-
Jul 1st, 2008, 04:19 AM
#5
Re: what does this line of code mean?
 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.
-
Jul 1st, 2008, 04:46 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|