Re: [PHP-DB] Informix Question (Still need help,please)

2001-06-22 Thread Christian Haul


On 21.Jun.2001 -- 02:22 PM, William Flow wrote:
 Chris,
Thanks for the advice, of course I already did rtfm and the
 ifx_fetch_rows entry did not really help me. It, in fact 
  does NOT return an enumerated array, as the top line of the page
 states. It ONLY returns an associative array. 

If you had said so, it would have been more obvious what your problem
is. The posting only showed ifx_htmltbl suggesting that you didn't try
ifx_fetch_row which would be the obvious solution to your problem --
read the results into variables.

So, you don't like the associative array. Well, you should really rtm
;-) 
Have a look at the array functions. You could pop or shift it, extract
all values to a new enumerated array or use foreach.

If you happen to have duplicate column names in your result, only one
will appear (even though ifx_htmltbl would produce correct output. In
this case you need to rename the columns. (SELECT TABLE1.ID AS ID1,
TABLE2.ID AS ID2 ...)

 I only did post the question, because I needed help and figured I would
 ask the experts, but all I got was somebody who says rtfm and most
 likely did not read or understand my question, so, thanks a lot.

You're welcome. No need to be sore. The answer fits the question. 
Next time, be a little more verbose on your problem and you'll get the 
help you desire. 

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-- 
PHP Database 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]




Re: [PHP-DB] Informix Question (Still need help,please)

2001-06-22 Thread Christian Haul


On 21.Jun.2001 -- 02:22 PM, William Flow wrote:
 Chris,
Thanks for the advice, of course I already did rtfm and the
 ifx_fetch_rows entry did not really help me. It, in fact 
  does NOT return an enumerated array, as the top line of the page
 states. It ONLY returns an associative array. 

If you had said so, it would have been more obvious what your problem
is. The posting only showed ifx_htmltbl suggesting that you didn't try
ifx_fetch_row which would be the obvious solution to your problem --
read the results into variables.

So, you don't like the associative array. Well, you should really rtm
;-) 
Have a look at the array functions. You could pop or shift it, extract
all values to a new enumerated array or use foreach.

If you happen to have duplicate column names in your result, only one
will appear (even though ifx_htmltbl would produce correct output. In
this case you need to rename the columns. (SELECT TABLE1.ID AS ID1,
TABLE2.ID AS ID2 ...)

 I only did post the question, because I needed help and figured I would
 ask the experts, but all I got was somebody who says rtfm and most
 likely did not read or understand my question, so, thanks a lot.

You're welcome. No need to be sore. The answer fits the question. 
Next time, be a little more verbose on your problem and you'll get the 
help you desire. 

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-- 
PHP Database 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]




Re: [PHP-DB] Informix question

2001-06-21 Thread Christian Haul

Bård Farstad [EMAIL PROTECTED] wrote:
 Hi all,

 I'm writing an application which uses the PHP interface to informix. I'm 
 having trouble with newlines in char/varchar or lvarchar fields.

 How can I store newlines (\n) to an informix database without using blobs?

You need to escape newlines or replace them eg. with br.

Chris.

-- 
PHP Database 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]




Re: [PHP-DB] Informix Question how to put data from query into variables

2001-06-21 Thread Christian Haul

wflow [EMAIL PROTECTED] wrote:
 Hi All,

 What I want to do is create another query from some of the data from another
 one. The question is how do I take the data I get back from my first query
 and put that into variables so I can build my second query. The example I
 have in mind is:

 I a do a select tracknum,orderdate,ordertotal,status,shipdate from orders
 where tracknum = '$trknum' and I want the data returned into vars: like
 orderdate = $orderdate so I can create a new query like: select * from
 shipping where orderdate = '$orderdate'.

 @ifx_htmltbl_result($sql_result,border=1);

You might want to consider reading the php manual, especially the part on functions
and even more the one on informix functions. There you'll find a function 
called ifx_fetch_row. 

Chris.

-- 
PHP Database 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-DB] Informix blobs problem -609 / core dump

2001-06-19 Thread Christian Haul

Hi.
 
When trying to insert anything into a BLOB column in informix I get a
-609 error back (invalid use of TEXT/BYTE host variable), no matter
what parameters used when ifx_create_blob'ing. Inserting into TEXT
columns does work OK.
 
When trying to read anything from a TEXT or BLOB column, php dies.
child pid 4286 exit signal Segmentation fault (11)
 
Setup
 
SuSE 7.0
Linux 2.2.19-i686 (PIII)
Informix Dynamic Server 2000 Version 9.21.UC3
apache 1.3.17
php-4.0.4pl1
 
or
 
Sun Solaris 7
U60
Informix Dynamic Server 2000 Version 9.20.UC2
php-4.0.4pl1
apache 1.3.11
 
Attached you'll find a) the db definition b) a small script for
inserting data and c) a small script to read the data.
 
As the informix code didn't change in 4.0.5 (no diff on source in
extensions/informix) I haven't tried upgrading.
 
Help appreciated.
 
TIA,
 
Chris.

--
create database test_shen in public;

database test_shen;

create table test (
   id serial,
   b1 blob,
   t1 text,
   primary key (id)
);

select * from test;

grant connect to 'infdb1';
grant all on test to 'infdb1';




-- 
PHP Database 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]