|
Posted by Marcin Dobrucki on 07/07/05 17:13
Shelly wrote:
> 1 - That class has a require of DB.php. There was none in the download.
> Where can I find that one.
pear.php.net
> 2 - It has the the syntax "$db =& DB::connect(DSN);" . What is the
> "::"? What is the "DB"?
>
> 3 - DSN was defined as "define ('DSN', 'pgsql://user@localhost/database');".
> Can you explain the second argument? It look like a URL.
Its an URI, not URL. PEAR::DB can take an argument as either a hash,
or a URI. It means "connect to a postgresql db as "user", on machine
"localhost", and access database called "database".
> 4 - In using this class, do I simply create a variable with something like:
> $my_var = new ZipCodesRange(<the arguments>);
> and then access the zipcodes that satisfy as:
> $my_var->zipcodes[$i] ?
"new" will create a new instance from class ZipCodeRange
> 5 - Can the zipcode table simply be a table in my main database?
Sure. You can store just about any kind of information in a db ;-)
[Back to original message]
|