If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

4) _read() may return ' ' (note the space). Is this behavior desired or should it return an empty string? The documentation says that the read function should return an empty string, if there's nothing to read (and that's the case here, imho).

5) The SQL in _read() is messed up, too. There are two single quotes, which should be escaped, but aren't.

6) In _write() $results is sometimes misspelled as $reults or $reulsts.

7) I think the insert query in _write() is never reached (if you fix the misspellings noted as #6).

8) Is it necessary that the sess_id column is 255 chararcters long? I thought that a session id would always be an 40-hexadecimal-character string.

I was in the process of uploading when I caught the time. I should have waited to test it, thanks for pointing out the errors though.

As for the constants, there is the slim possibility that the user won't always be using the same connection, so I'd rather leave that up to them to define. However, I'll replace them with a connection function.

As it stands right now, PHP seems to be pick and choosing which files it parses (which is really stating to make me mad) and I can't test it. I'll bring this up with the server admin and sort this out. As for now, use at your own disgression, though it SHOULD be safe and fixed now.

Also, just a general comment, but it would be great to provide a short description of the purpose of the script when posting. For people who have no idea what PostGres is in this case for example, that'd be most helpful.