[PHP-DB] PostgreSQL functions missing

2006-04-26 Thread Tony Grimes
Hi, My sys admin installed an update to H-Sphere (control panel software) that broke PEAR::DB and phpBB last week. After much trial and error, I finally tracked it down to missing pg_affected_rows() and pg_cmdtuples() functions (for PEAR and phpBB respectively) in PHP. I'm assuming that the

Re: [PHP-DB] PostgreSQL functions missing

2006-04-27 Thread Tony Grimes
On 4/26/06 8:55 PM, chris smith [EMAIL PROTECTED] wrote: On 4/27/06, Tony Grimes [EMAIL PROTECTED] wrote: Hi, My sys admin installed an update to H-Sphere (control panel software) that broke PEAR::DB and phpBB last week. After much trial and error, I finally tracked it down to missing

[PHP-DB] Unicode error with PostgreSQL

2006-09-26 Thread Tony Grimes
I'm getting the following error when PHP tries to insert a Unicode character (the problem word is resume with the accents) into a PostgreSQL database: pg_exec(): Query failed: ERROR: Invalid UNICODE character sequence found (0xe97375) I can't figure out why I'm getting the error. The HTML form

Re: [PHP-DB] Error when trying to connecting to an Oracle database

2006-09-26 Thread Tony Grimes
Hi Janet, This is a PHP 5 only function. Are you running PHP 5? If not, try using ocilogon() instead. If you are running 5, then maybe the Oracle library wasn't included when PHP was compiled. HTH, Tony On 9/26/06 2:13 PM, Janet Smith [EMAIL PROTECTED] wrote: I am trying to use a program

Re: [PHP-DB] Unicode error with PostgreSQL

2006-09-26 Thread Tony Grimes
So does that mean I will always get that error? There's got to be a way around that. Is there at least a way to detect invalid characters before I try to insert? Tony On 9/26/06 1:17 PM, Niel Archer [EMAIL PROTECTED] wrote: PHP isn't multibyte aware by default. Niel -- PHP Database

Re: [PHP-DB] Error when trying to connecting to an Oracle database

2006-09-26 Thread Tony Grimes
Hi Janet, This is a PHP 5 only function. Are you running PHP 5? If not, try using ocilogon() instead. If you are running 5, then maybe the Oracle library wasn't included when PHP was compiled. HTH, Tony On 9/26/06 2:13 PM, Janet Smith [EMAIL PROTECTED] wrote: I am trying to use a program

Re: [PHP-DB] Unicode error with PostgreSQL

2006-09-26 Thread Tony Grimes
So does that mean I will always get that error? There's got to be a way around that. Is there at least a way to detect invalid characters before I try to insert? Tony On 9/26/06 1:17 PM, Niel Archer [EMAIL PROTECTED] wrote: PHP isn't multibyte aware by default. Niel -- PHP Database

[PHP-DB] EXISTS syntax for SELECT INTO?

2006-10-11 Thread Tony Grimes
I have a script that creates a table copy using SELECT INTO, but I want it to check if the new table already exists first. Does SQL support the EXISTS keyword for SELECT INTO statements (I'm running PG7)? If not, is there another way to do it in SQL? I'd rather not do it programmatically. Thanks

Re: [PHP-DB] barcode

2006-10-21 Thread Tony Grimes
One of my programmers did something exactly like this. I can't remember specifics, but the car code is alpha numeric and displayed in a special 'barcode' font on the page. If you don't store any information in the code, why not just use the PHP session id? Tony On 10/21/06 3:54 AM, Mad Unix

Re: [PHP-DB]: small question php/postgreSQL

2006-11-07 Thread Tony Grimes
Is your server configured to display errors? Try adding this at the top of your script: ini_set('display_errors',true); It won't catch syntax errors, but it should help. Also, try adding this to the top of your script: echo 'test'; If you still get a blank page, then it's probably not a

Re: [PHP-DB] RE : Re: [PHP-DB]: small question php/postgreSQL

2006-11-07 Thread Tony Grimes
, 'cos I tried 'hello.php' before getting into the db 'thang', and I saw the text on the screen. Well .. back to the drawing board... D. Tony Grimes [EMAIL PROTECTED] a écrit : Is your server configured to display errors? Try adding this at the top of your script: ini_set

Re: [PHP-DB]: small question php/postgreSQL

2006-11-07 Thread Tony Grimes
' ? Bingo. I then take the *same* file, I don't rename it, I just open it in vi. I copy a single occurrence of 'pg_connect' etc... And the 'hello world' disappears. D. Tony Grimes [EMAIL PROTECTED] a écrit : Is your server configured to display errors

Re: [PHP-DB] Database abstract layer

2006-11-07 Thread Tony Grimes
Why not build the options into your data model? Instead of using integers for gender, use a varchar field that stores 'Male' and 'Female'. You can ensure data integrity by adding a check constraint to the column. If the presentation might change depending on context, you can create gender

[PHP-DB] SQL Performance Help

2006-12-27 Thread Tony Grimes
I'm developing a course calendar for a client and I'm running into performance problems with the admin site. For example, when I try to include registration counts in the course list, the page really slows down for large course lists (50 or so): COURSEATTENDEES CAPACITYSEATS LEFT

[PHP-DB] MySQL sort stopped working

2007-03-13 Thread Tony Grimes
I have this page that lists artists alphabetically: http://www.wallacegalleries.com/artists.php At least it did until today. Nobody made any changes to the files, but the database stopped sorting by artist_id. The list shown is just the default order that mysql spits out if the SORT BY clause is

[PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
I'm using BETWEEN to return a list all people who's last names fall between A and F: WHERE last_name BETWEEN 'A' AND 'F' ... but it's only returning names between A and E. The same thing happens when I use: WHERE last_name = 'A' AND last_name = 'F' ... Shouldn't this work the way I

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
PM, Dan Shirah [EMAIL PROTECTED] wrote: So just change it to WHERE last_name BETWEEN 'A' AND 'G' . That'll get you Aa-Fz :) On 5/18/07, Tony Grimes [EMAIL PROTECTED] wrote: We tried that and it didn't work. We've also tried every combination of upper and lower case too. Tony

Re: [PHP-DB] MySQL BETWEEN Problems

2007-05-18 Thread Tony Grimes
where substr(name, 1, 1) = 'A' and substr(name, 1, 1) = 'B'; -B Dan Shirah wrote: So just change it to WHERE last_name BETWEEN 'A' AND 'G' . That'll get you Aa-Fz :) On 5/18/07, Tony Grimes [EMAIL PROTECTED] wrote: We tried that and it didn't work. We've also tried every combination

[PHP-DB] Remote DB Connection: Pros and Cons?

2007-10-11 Thread Tony Grimes
Have any of you tried running a PHP website using a remote database connection? We currently have an in-house PHP website driven by a PostgreSQL database that is HEAVILY administered within the office with an administration sister site (also PHP). Problem: the office connection is having

Re: [PHP-DB] Remote DB Connection: Pros and Cons?

2007-10-11 Thread Tony Grimes
by remote connection would be easier, but we're worried about the performance. Tony On 10/11/07 6:01 PM, Chris [EMAIL PROTECTED] wrote: Tony Grimes wrote: Have any of you tried running a PHP website using a remote database connection? We currently have an in-house PHP website driven

Re: [PHP-DB] Remote DB Connection: Pros and Cons?

2007-10-12 Thread Tony Grimes
Thank you all for the responses. I think we're going to try replicating the databases with Slony. Wish me luck! Tony On 10/11/07 6:23 PM, Chris [EMAIL PROTECTED] wrote: Tony Grimes wrote: Splitting the tables probably wouldn't work. Most of the tables are used by both sites and the ones

[PHP-DB] PG: Table last updated?

2007-10-23 Thread Tony Grimes
We've got a huge table in one of our Postgres databases and nobody seems to know what it's for. Do any of the system tables keep track of the last time the table was altered (i.e. Row INSERTs, UPDATEs, etc)? Tony -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] PG: Table last updated?

2007-10-23 Thread Tony Grimes
I'm not sure. How can I tell? This database is running on a different server than the one that created the data. I'm trying to restore a fried server from a backup. Not sure if that matters. Tony On 10/23/07 6:20 PM, Bastien Koert [EMAIL PROTECTED] wrote: Is logging turned on? bastien

Re: [PHP-DB] Question about database design

2007-10-24 Thread Tony Grimes
A second address table is definitely the way to go (the '*' signifies the primary key): People Table *user_id first_name last_name etc Address Table (compound primary key) = *user_id (fk to People Table) *address_id *obs_no (you can skip this if you don't want to keep an