|
Posted by Jerry Stuckle on 10/02/07 02:37
Jim Carlock wrote:
> "RageARC" wrote...
>> using namespace curl;
>> init...
>> exec...
>> close...
>
> That looks like Visual Basic 3/4/5/6...
>
> Dim db As DAO.Database
> Dim rs As DAO.Recordset
> Dim sSQL As String
>
> sSQL = "Select * From customers;"
> With DAO
> Set db = .OpenDatabase("mydata.mdb")
> Set rs = .OpenRecordset(sSQL)
> End With
>
> '... rest of the code
>
> Except I think it works a little better with the "With" in
> Visual Basic.
>
> What's the advantage of a namespace if you have 5 different
> databases to connect to?
>
Absolutely nothing. Namespaces are for source code separation, not
database selection.
> Anyone have a good example of using namespaces?
>
Let's say you have two different packages, each with:
class ExampleClass
Now if you include both packages in the same PHP file, you'll get a
parsing error for the second instance of ExampleClass.
So, you have two different namespaces. Put each one in its own
namespace and you can use both.
Think if it as an implicit prefix to everything defined within the
namespace.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|