[PHP] Re: naming conventions

2001-07-27 Thread Jeremy Maziarz

Matthew,

The convention I use goes as follows:

[ I am doing this without testing as I go so if something is wrong,
don't sue me :P ]

Lets say I have two tables...

PEOPLE
people_id (primary key)
people_namefirst
people_namelast
people_namemiddle
people_age
place_id (foreign key)

PLACE
place_id (primary key)
place_name
place_address
place_numberphone
place_numberfax

What I do is use [tablename]_[fieldname]. This convention makes SELECT
statements like this easy...

SELECT people.people_id,
people.people_namefirst,
place.place_id,
place.place_address
FROM people, place
WHERE people.place_id = place.place_id
AND place.place_name = 'IBM';

Otherwise, it would be difficult to differenciate between place_id (the
foreign key for the PEOPLE table) and place_id (the primary key for the
PLACE table).

-Jeremy
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: .htaccess

2001-07-24 Thread Jeremy Maziarz

Jon,

Try $REMOTE_USER

-Jeremy
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: LDAP compile problem.

2001-07-18 Thread Jeremy Maziarz

Johan,

As the PHP documentation points out in Function Reference: LDAP
functions:

...You will need to get and compile LDAP client libraries from either
the
University of Michigan ldap-3.3 package or the Netscape Directory SDK
3.0. You will also need to recompile PHP with LDAP support enabled
before
PHP's LDAP calls will work...

Here is a link to this page:

http://www.php.net/manual/en/ref.ldap.php

So, after compiling the LDAP client libraries you will want to
configure with
the --with-ldap option, for example (if you install the libraries to
/usr/local):

$ ./configure [...all other options...] --with-ldap=/usr/local

-Jeremy Maziarz
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Just like to know

2001-07-18 Thread Jeremy Maziarz

Jeroen,

I guess it depends on your coding style and preference. Functionally,
they do the same thing. First line is easier to read while the second
line requires more typing.

One note. This will not work (using an associative array):

?php
$somevar = array(foo=bar);
$string1 = bla bla $somevar[1] bla bla bla $somevar[foo]$somevar[1]
bla;
?

-Jeremy Maziarz
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Code works in reverse order...

2001-07-18 Thread Jeremy Maziarz

Dhaval,

Without looking into this further, the one thing that stands out to me
(I am pretty sure) is the fact that mysql_num_rows() returns an int. So
testing for  (empty string) is not going to work. Try instead:

...
if ($check != 0)
...

-Jeremy Maziarz
Email: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]