Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ricardo Lopes
That may depend of what database server you are using, for mysql you can use: WHERE (LEFT('Brick',3) = LEFT(Post Code,3)) If you are using other dbserver, check your manual. - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 1

RE: [PHP-DB] sql, problem with join and presentation

2004-02-17 Thread Angelo Zanetti
i think the newer versions of MYSQL allow for subselects and I think that is what you want. see www.mysql.net -Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: Sunday, February 15, 2004 11:56 PM To: php-db Subject: [PHP-DB] sql, problem with join and presentation Currently

[PHP-DB] select in a object tables

2004-02-17 Thread Sergio
¡Hi all! I have a problem and I don't find the solution, my problem is when I try to do a select on a object table, it returns '*Warning*: Ora_Parse failed (ORA-00911: carácter no válido -- while processing OCI function OPARSE)' I'm working with this code in pl/sql : create Type TArtPrueba

[PHP-DB] resultset problem

2004-02-17 Thread Angelo Zanetti
HI all, I am querying a db and getting the resultset, then to get out each individual field of the resultset (which is a single unique line all the time) as mysql_result($result2, 0, "p_company"). the problem is that if the actual field has a space in it say "Sun microsystems", I only get "sun" a

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Shaun
Thanks for your reply, but what I actually need to do is compare the first 3 or 4 digits of the postcode stored in locations to the same in the Brick table... "Ricardo Lopes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > That may depend of what database server you are using, for

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ricardo Lopes
I think this is what you want: SELECT * FROM Locations L, Brick B WHERE (LEFT(L.'Post Code',3) = LEFT(B.Brick,3)) If you want to select 4 characters change the 3 to 4 :-) Avoid using spaces and special characters in your column it may give you problems. - Original Message - From: "Shau

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ignatius Reilly
Hmmm... Better try: WHERE (LEFT( Brick,3) = LEFT(`Post Code`,3)) ^^ no quotes^^ back ticks (because of the space in the column name) HTH Ignatius _ - Original Message - From: "Ricardo Lopes" <[EMAIL PROTECTED]> To: "Shaun" <[EMAIL PR

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Shaun
Thank you for your replies, The brick and postcode will never match so I need to compare the Postcode in Locations to the Postcode in Brick. Something like: SELECT B.Brick FROM Locations L, Brick B WHERE (LEFT(L.Postcode,3) = LEFT(B.Postcode,3)) The problem is that some of the postcodes stored i

[PHP-DB] Problem with ODBTP

2004-02-17 Thread Sascha Kaufmann
Hello everyone I try to port an application from Windows/ODBC to Linux/ODBTP, I have a MSSQL Server 2000. If I use the function odbtp_fetch_row, I get the following warn message: "Warning: [ODBTPERR][0]Detached object in ". Anyone a idea what this could mean? Google won't told me that :( best r

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ricardo Lopes
SELECT * FROM Locations L, Brick B WHERE (LEFT(L.'Post Code', LOCATE(' ', L.'Post Code') = LEFT(B.Brick, LOCATE(' ', L.'Post Code'))) The functions if locate gives you the position of the character in the string, if this is not what you whant you can search the mysql string functions documentation

[PHP-DB] PHP & oracle 9.2

2004-02-17 Thread Delfins
Hello php.db! i have successfully installed Oracle 9.2 on Slackware 9.0 database works fine & also any other applications runs ok. but when i compiled PHP5 with OCI8 (path i was specified as ORACLE_HOME) but running some scrip, i have this error : Warning: ocilogon(): _oci_open_server: Error while

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ricardo Lopes
Ignore the previous post it has an error. This is the corrected sql: SELECT * FROM Locations L, Brick B WHERE (LEFT(L.'Post Code', LOCATE(' ', L.'Post Code')) = B.Brick) This should do it. - Original Message - From: "Ricardo Lopes" <[EMAIL PROTECTED]> To: "Shaun" <[EMAIL PROTECTED]> Cc

Re: [PHP-DB] PHP & oracle 9.2

2004-02-17 Thread Christopher Jones
Delfins wrote: i have successfully installed Oracle 9.2 on Slackware 9.0 database works fine & also any other applications runs ok. but when i compiled PHP5 with OCI8 (path i was specified as ORACLE_HOME) but running some scrip, i have this error : Warning: ocilogon(): _oci_open_server: Error wh

Re: [PHP-DB] Problem with ODBTP

2004-02-17 Thread Robert Twitty
Your query resource was detached from the connection. Can you supply the code prior to calling odbtp_fetch_row() and starting from odbtp_query()? -- bob On Tue, 17 Feb 2004, Sascha Kaufmann wrote: l > Hello everyone > > I try to port an application from Windows/ODBC to Linux/ODBTP, I have a > MS

[PHP-DB] pg_escape_bytea

2004-02-17 Thread Hiro
hi! I am using pg_escape_bytea to store large object into PostgresSQL. Fortunaly, I can insert and retrieve the binary file in postgresql. I would like to research the text from mictosoft word documentaion and PDF and so on inside postgresql database. Do anyone know how to find text from

Re: [PHP-DB] sql, problem with join and presentation

2004-02-17 Thread Frank Flynn
There are two ways to do what you ask: 1 - run your first query (just the classes no sections) and before the loop to display the results open a new - different connection to the DB then in the loop where you are displaying the results after displaying each class run a query to find all of it's se

RE: [PHP-DB] sql, grouping problem - THX

2004-02-17 Thread mayo
Thank you John, That did the trick. Gil > -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED] > Sent: Monday, February 16, 2004 9:46 PM > To: mayo > Cc: php-db > Subject: Re: [PHP-DB] sql, grouping problem > > > mayo wrote: > > > cold fusion allows you to grou

[PHP-DB] SQLite behaving bad?

2004-02-17 Thread Gerard Samuel
Currently using sqlite 2.8.11 (distributed by php snaps) with php4.3.5rc2 on windows XP. Several months ago, I added support for sqlite in a database abstraction class I created. It worked great then. Im trying to see if things are still ok today, and its not. For example executing the select que

[PHP-DB] php/mysql weblog - addnews function problems

2004-02-17 Thread Slippyaah
hey, I've been working on a PHP/MYSQL weblog and I've got most of it working apart from the adding new news function and a login section. I've set the form up but it is coming up with a few errors and the actual submitting of data doesn't work as of yet. The code is too long to include in this

[PHP-DB] Update Statement

2004-02-17 Thread Ng Hwee Hwee
hi all, I would like to do the following: update Table1, Table2 set Table1.field1 = Table2.field2 where Table1.no = Table2.no however, i found that multiple updates can only work for MySQL version 4.0.4 but mine is 3.23.54... can anyone enlighten me on how I can achieve the same results with th

[PHP-DB] Is it safe to do this?

2004-02-17 Thread JeRRy
Hi, Is it safe to do this: foreach ($addresses as $email) { $body = str_replace($email, $comp_uri, $body); mysql_query ("update users SET email_setting='-1' WHERE email='$email'") or die ("Can't set email_setting"); mysql_query ("UPDATE users SET email_setting='-1' WHERE email

[PHP-DB] Re: Is it safe to do this?

2004-02-17 Thread Justin Patrin
That depends on what you're doing. Here's why I can't provide feedback: 1) Your code isn't at all complete, the foreach isn't even finished. 2) Where does the $addresses variable come from and what are you trying todo with it? 3) What is the mysql table and its columns supposed to represent?

[PHP-DB] Re: resultset problem

2004-02-17 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > HI all, > > I am querying a db and getting the resultset, then to get out each > individual field of the resultset (which is a single unique line all the > time) as mysql_result($result2, 0, "p_company"). the problem is that if the > ac

[PHP-DB] Re: php/mysql weblog - addnews function problems

2004-02-17 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > hey, > > I've been working on a PHP/MYSQL weblog and I've got most of it working > apart from the adding new news function and a login section. I've set the > form up but it is coming up with a few errors and the actual submitting of >