Re: [PHP-DB] Informix and PHP

2004-05-22 Thread Martin Marques
El Vie 21 May 2004 14:48, D. Sandmann escribió:
 Any help would be appreciated on this. I have already asked this question
 on the regular PHP and Informix news groups and have not had any luck.
 Maybe one of you can resolve my problem.

 I have had this problem in the past on another machine and fixed it by
 setting the environment variables for INFORMIXDIR and INFORMIXSERVER. When
 adding the same lines on the new machine I still get the following message:

  Warning: ifx_pconnect(): E [SQLSTATE=IX 001 SQLCODE=-1829] in
 C:\webroot\PHPinclude\db_vars.inc on line 7

Maybe it's becuase Informix has some problems. I don't know how it works on 
windows, but on UNIX I would run:

$ finderr -1829

That would give me a discription of the error that Informix gave Apache.

Try it.

-- 
 09:20:02 up 7 days, 19:31,  1 user,  load average: 0.60, 0.49, 0.37
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Informix and PHP

2004-05-21 Thread D. Sandmann
Any help would be appreciated on this. I have already asked this question on
the regular PHP and Informix news groups and have not had any luck. Maybe
one of you can resolve my problem.

I have had this problem in the past on another machine and fixed it by
setting the environment variables for INFORMIXDIR and INFORMIXSERVER. When
adding the same lines on the new machine I still get the following message:

 Warning: ifx_pconnect(): E [SQLSTATE=IX 001 SQLCODE=-1829] in
C:\webroot\PHPinclude\db_vars.inc on line 7

I tried doing what I did before, but still is not working. Doing
phpinfo(); The following information (abbreviated) is displayed:

=== phpinfo begin 
PHP Version 4.3.6

System Windows NT DAVIDS 5.1 build 2600
Build Date Apr 14 2004 17:17:11
Server API Apache 2.0 Handler

Under apache2handler:
 Apache Version Apache/2.0.49 (Win32) PHP/4.3.6

Under Apache Environment:
 INFORMIXDIR C:\informix
 INFORMIXSERVER dbserver

And under Environment I have:
 INFORMIXDIR C:\informix

=== phpinfo end 

I am using the Informix-Client 9.21 2.30.TC1. I have been able to connect to
the Informix database using ILogin Demo and I have been able to connect
using WinSQL.

These are the lines I have in httpd.conf and they happen after the standard
LoadModule area:

=== Lines from httpd.conf ===
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so

##
# Start - Informix Stuff
##
SetEnv INFORMIXDIR C:\informix
SetEnv INFORMIXSERVER emco5
##
# End - Informix Stuff
##

LoadModule php4_module c:\PHP\sapi\php4apache2.dll
#AddModule mod_php4.c
AddType application/x-httpd-php .php


#
# ExtendedStatus controls whether Apache will generate full status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the server-status handler is called. The default is Off.
#
#ExtendedStatus On
=== End of lines from httpd.conf ===

Any help would be appreciated.

Thanks,
David

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Informix - help!

2003-12-15 Thread Martin Marques
El Dom 14 Dic 2003 19:00, Daniel Crespo escribió:
 I have red hat linux with Apache web server and PHP. I want to connect,
 using PHP, to an Informix Database remotely. What is all I have to do on my
 side? Thanks a lot

Install informix client libraries where php will go and compile using 
--with-informix. Remember to add the environment informix variables (can't 
remember which ones they were) before running configure.

You will also have to give permission of access in the informix server to your 
web server.

-- 
 15:20:02 up 16 days, 21:36,  3 users,  load average: 1.37, 0.91, 0.69
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Informix - help!

2003-12-14 Thread Daniel Crespo
I have red hat linux with Apache web server and PHP. I want to connect,
using PHP, to an Informix Database remotely. What is all I have to do on my
side? Thanks a lot

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Informix function

2003-11-21 Thread Juan Ringhetti
Hi,

I have a problem with PHP ifx_num_rows function. Once is executed after a
ifx_query function it always returns 0 value (even the ifx_query return a
couple of rows). I know that is a PHP bug (I have a php4.1.1 version), but,
how can I do to solve this bug in a standard way? Without use select
count(*) query.

Thanks in advance

Juan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] informix error

2003-11-19 Thread Adam Williams
Hi, I was wondering if anyone has seen this informix error before.  It has 
me stumped.  Searching on google didn't reveal anything.  Running my query 
in informix returns the proper results, so I'm not sure what the problem 
is.

Warning: ifx_fetch_row(): 4 is not a valid Informix Result resource in 
/usr/local/apache2/htdocs/alephpub/rg2a.php on line 86

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] informix error

2003-11-19 Thread jeffrey_n_Dyke

this is usually based on what your passing this function.  it can be a
result of a bad query or just a bad variable.  do you have the correct
variable that is holding a result of an ifx_query() call.

if you could post the prior lines of this that would probably make it
clearer.

also try var_dump($var); where the variable is what you are passing into
ifx_fetch_row.

it looks like you have passed in an variable  holding (int) 4

hth
Jeff


   
 
  Adam Williams
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  ate.ms.us   cc: 
 
   Subject:  [PHP-DB] informix error   
 
  11/19/2003 01:01 
 
  PM   
 
   
 
   
 




Hi, I was wondering if anyone has seen this informix error before.  It has
me stumped.  Searching on google didn't reveal anything.  Running my query
in informix returns the proper results, so I'm not sure what the problem
is.

Warning: ifx_fetch_row(): 4 is not a valid Informix Result resource in
/usr/local/apache2/htdocs/alephpub/rg2a.php on line 86

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Informix 9.20 ifx_query SQLCODE=-410

2003-10-10 Thread Tomá¹ Tominec
Hi,
I have Informix 9.2 on Solaris and IIS on XP professional.
when I run SQL statement,

$conn_id = ifx_connect ([EMAIL PROTECTED], name, pwd);

$qry =  SELECT a,b  FROM c ;

if (! $conn_id) {
printf(Cannot connect to the DB SERVER.);
}
$res = ifx_query($qry,$conn_id);

 I will get error:
  Warning: ifx_query(): Describe fails (E [SQLSTATE=37 000 SQLCODE=-410])


The same SQL statement run corectly with ODBC.

$conn_id = odbc_connect (odbc_alias, name, pwd);

$qry =  SELECT a,b  FROM c ;

if (! $conn_id) {
printf(Cannot connect to the DB SERVER.);
}
$res = odbc_exec($conn_id,$qry);


Thank's for help.

Tomas

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] INFORMIX PROBLEM

2003-08-27 Thread Luigi Vellucci
Hi I'm trying to compile php 4.1.2 from the source RPM in RedHat 7.3 but
I wasn't succesfully. Please does anybody know what it means the 
following error:

*** Warning: Linking the shared library libphp4.la against the non-libtool
*** objects  /opt/informix/lib/esql/checkapi.o is not portable!
/bin/sh /usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent 
--mode=link gcc -I. -I/usr/src/redhat/BUILD/php-4.1.2/ 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main 
-I/usr/src/redhat/BUILD/php-4.1.2 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2 
-I/usr/include/freetype2/freetype -I/usr/include/imap 
-I/opt/informix/incl/esql -I/usr/include/mysql -I/usr/local/include 
-I/usr/include/pspell -I/usr/include/ucd-snmp 
-I/usr/local/freetds/include/include 
-I/usr/src/redhat/BUILD/php-4.1.2/main 
-I/usr/src/redhat/BUILD/php-4.1.2/Zend 
-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 
-mcpu=i686 -fPIC  -L/usr/kerberos/lib -o php -export-dynamicstub.lo 
libphp4.la
/usr/bin/ld: cannot find -lifsql
collect2: ld returned 1 exit status
make[1]: *** [php] Error 1
make[1]: Saliendo directorio `/usr/src/redhat/BUILD/php-4.1.2/build-cgi'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.72521 (%build)

RPM build errors:
   Bad exit status from /var/tmp/rpm-tmp.72521 (%build)
Thanks in Advance.

Luigi.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] INFORMIX PROBLEM

2003-08-27 Thread Martin Marques
El Mié 27 Ago 2003 16:01, Luigi Vellucci escribió:
 Hi I'm trying to compile php 4.1.2 from the source RPM in RedHat 7.3 but
 I wasn't succesfully. Please does anybody know what it means the
 following error:

 *** Warning: Linking the shared library libphp4.la against the non-libtool
 *** objects  /opt/informix/lib/esql/checkapi.o is not portable!
 /bin/sh /usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent
 --mode=link gcc -I. -I/usr/src/redhat/BUILD/php-4.1.2/
 -I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main
 -I/usr/src/redhat/BUILD/php-4.1.2
 -I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2
 -I/usr/include/freetype2/freetype -I/usr/include/imap
 -I/opt/informix/incl/esql -I/usr/include/mysql -I/usr/local/include
 -I/usr/include/pspell -I/usr/include/ucd-snmp
 -I/usr/local/freetds/include/include
 -I/usr/src/redhat/BUILD/php-4.1.2/main
 -I/usr/src/redhat/BUILD/php-4.1.2/Zend
 -I/usr/src/redhat/BUILD/php-4.1.2/TSRM
 -I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386
 -mcpu=i686 -fPIC  -L/usr/kerberos/lib -o php -export-dynamicstub.lo
 libphp4.la
 /usr/bin/ld: cannot find -lifsql

Add this line to /etc/ld.so.conf
/opt/informix/lib

and run ldconfig.

Then try to compile again.

-- 
 17:33:02 up 5 days,  9:23,  3 users,  load average: 0.85, 0.76, 0.63
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] INFORMIX (URGENT)

2003-08-18 Thread Davi José Faria Costa
Hello Everybody, 
I wait that somebody can help me, therefore already I depleted my possibilities. 
I need to develop a site in PHP with access to the Data base Informix. 
The such of the data base alone functions with NTFS (W2k, WNT). 
I installed the W2K Advanced Server in my house... and installed INFORMIX IDS 7.31. 
Now the problems start. 
 
IN THE INFORMIX 
- It does not obtain to initiate a ISM. service. (Informix Storage Manager). 
I do not know if this influences in some thing. 
 
- When time to create a new DATABASE... it is in the RUNNING... message and stops
 Now it becomes a big problem! What´s happening? 
 
- Good... for creating database I was not obtaining success... but.. in databases that 
already 
they were created I obtained to make select, etc.. (this in the DBACCESS). 
So..I asked myself: If I to obtain to connect to this database and to create a table 
inside already the created database
, could help me.. Correct? Theoretically yes. however in the time that I go to create 
database comes the message of the RUNNING...
and again.. freezee in this message.
 
IN THE PHP 
- Exactly that the bank does not make nothing. I tried to make the connection for the 
PHP. 
We have 2 ways: 
a) Functions IFX of php I take off the commentary of line EXTENSIONS in the PHP.ini 
where I meet DLL PHP_IFX.DLL. 
The DLL is exactly in the way that I passed, however gets an error (unable you load 
dynamic library) 
Piece o cake ah? 
Obs. I also have client in the INFORMIX installed certinho in mine máquinha. 
 
b) ODBC In the time that I thought about these solutions I had the certainty that my 
problems would go to finish. 
I was missed again..(smiles)
 i have create the ODBC correct and such. I called the function connection to the ODBC 
passing the DSN, USER, PASSWORD. 
And i got an error message. 
Warning: Error SQL: [ Informix][Odbc Informix Driver]Unable you load translation DLL, 
SQL state IM009 in SQLConnect in 
d:\inetpub\wwwroot\teste.php on line 3 
Now... my possibilities if had depleted... 
I do not know more what to make this to function... 
Somebody please, help me. 
 
My environment is the following one: 
- COMPUTER K6-2 500 
- HD 10GB, MEM RAM 64 MB 
- WINDOWS 2000 ADVANCED SERVER 
- INFORMIX NT 7.31 
 
Thanks!
 
Davi Costa


[PHP-DB] Informix varchar nonprintable characters

2003-07-16 Thread Agusti Fita
Hello:

We have developed a project that runs over several database engines with 
de ADODB php library. At this moment it's runing over MySQL, MSSQL 
Server and Informix through the Linux Informix Client SDK ODBC driver.

We need to store non-printable characters into varchar fields (ASCII 
code below 32). This works OK in Mysql , MSSQL Server and Informix 
through ODBC.

We've built the PHP4 4.3.2 Informix module in a Debian Woody to avoid 
the ODBC overload. All seems OK except when we try to insert something 
like this:

$sql = INSERT INTO table (txt) VALUES ( chr(3).chr(5).Hello );

Informix returns an error of Invalid character.

In fact, the same query with the ODBC driver runs without problems.

Well, is there any trick to avoid this problem?
Is possible to escape these characters?
Thanks a lot in advance !

Sorry for my English, I'm not a native speaker.

Agustí Fita.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Informix

2003-01-14 Thread Foong
Hello,
Does any one know how to connect to Informix database on a Different
server??

I have searched on google, php.net but couldn't get a details guide on what
to set.

the ifx_connect() does not give me an option to pass in the database server
ip. Do I need to set it somewhere else??

Foong



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Informix

2002-10-09 Thread Simon Taylor

Does anyone know of a good infrmix list I am in a fix..
Thanks
_
Simon Taylor
AfriTol (Pty) Ltd.
?  [EMAIL PROTECTED]
Å+27 12 361 3303 ext 257
Å+27 72 471 1833
Æ+27 12 365 3810
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Informix ifx_close

2002-07-24 Thread Martins Junkers

I have following script:
?
$db=ifx_connect(db,uid,pwd);

$result=ifx_query(begin work,$db);
$result=ifx_query(insert into m_test1 (i) values('1');, $db);
$result=ifx_query(select * from m_test1;, $db);
while($row=ifx_fetch_row($result)) {
echo($row['i']);
}
$result=ifx_query(rollback work;, $db);
echo(rollback);
$result=ifx_query(select * from m_test1;, $db);
while($row=ifx_fetch_row($result)) {
echo($row['i']);
}
ifx_close($db);

?


If i dont execute $result=ifx_query(rollback work;, $db); and just call
ifx_close session is not closed and autmatic rollback is not execute (as it
must be) but connection to Informix database stays with lock on this row.

Usualy you must have rollback or commit; But to avoid problems with bad code
or other coding probs after calling ifx_close() session must be rolled back
and closed.

What is solution for this case?

Martins Junkers



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] informix stored procedures exception handling

2002-06-04 Thread Andrey V. Glukhov

I am moving to php-4.2.1 now and still looking for explanation how to use
exeption
handling in informix stored procedures. As I've wrote a year ago here,
when I trying to execute the following php code:

?
$connid=ifx_connect(basename,username,password );

$q=execute procedure test();
$i=ifx_query($q,$connid);
echo( ifx_errormsg() );

ifx_free_result($i);
?

and stored procedure is:
CREATE PROCEDURE TEST()
   RAISE EXCEPTION -746, 0, testing...;
END PROCEDURE

I expect to see testting... but see nothing.
After applaying patch the code work  fine.

--- ifx.ec.original Mon Jun  3 19:02:27 2002
+++ ifx.ec  Wed Jun  5 10:07:10 2002
 -756,6 +756,7 
int  cursoryproc;
int  argc=ZEND_NUM_ARGS();
long ifx_type;
+ char errmsg746[72];

if(argc  2 || zend_get_parameters_ex(argc, query, ifx_link,
dummy, dummy)==FAILURE) {
WRONG_PARAM_COUNT;
 -921,8 +922,10 

if (ifx_check()  0) {
IFXG(sv_sqlcode) = SQLCODE;
+  strcpy(errmsg746, sqlca.sqlerrm);
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
+  strcpy(sqlca.sqlerrm, errmsg746);
efree(Ifx_Result);
php_error(E_WARNING,Execute immediate fails : %s
(%s), statement, ifx_error(ifx));
RETURN_FALSE;


Best wishes
Andrey Glukhov










-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Informix + PHP any gotcha's to watch out for?

2001-10-23 Thread Mark Roedel

 -Original Message-
 From: davemacgb [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, October 22, 2001 12:12 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Informix + PHP any gotcha's to watch out for?
 
 
 I've only used MySQL via PHP until now, does anyone know of 
 any gotchas that I should watch out for?
 
 The web site will hopefully run on Linux using Apache and PHP.

A few things that I've run into so far:

Make sure that your INFORMIXDIR environment variable is set.  Apache
would segfault on my systems when I tried to use any of the informix
functions otherwise.  I added a line to my apachectl script just to be
sure.

Ifx_connect() doesn't take quite the same parameters as mysql_connect().
The server you're connecting to is specified via either the
INFORMIXSERVER environment variable or one of the ifx default settings
in your php.ini.  (In either case, it's a pointer to an entry in your
INFORMIXDIR/etc/sqlhosts, not a hostname.)  Ifx_connect() also expects
the database name that you're connecting to.

Obviously, in light of the above, there is no ifx_select_db().

Ifx_num_rows() doesn't do the same thing as mysql_num_rows().  It counts
the number of rows that you've viewed from the result set, not the total
number of rows returned.

If you use mysql_fetch_array(), the equivalent Informix function is
ifx_fetch_row().


---
Mark Roedel |  Blessed is he who has learned to laugh
Systems Programmer  |   at himself, for he shall never cease
LeTourneau University   |   to be entertained.
Longview, Texas, USA|   -- John Powell 

--
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 + PHP any gotcha's to watch out for?

2001-10-22 Thread davemacgb

I've been asked to create a B2B web site for on-line ordering.

The customer's software runs on SCO OpenServer 5 (UNIX) unfortunately the
run-time environment for the software is limited to either its own
proprietary database, Informix or Oracle. This means that switch to another
database like MySQL or PostgreSQL is not an option. The run-time's
developers offer their own ODBC driver for their db but I don't trust it
enough to run a web site though it. As Oracle is expensive this leaves
Informix.

I've only used MySQL via PHP until now, does anyone know of any gotchas that
I should watch out for?

The web site will hopefully run on Linux using Apache and PHP.


David McCormack




-- 
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 - ifx_num_rows

2001-08-22 Thread Leila

Hi all,

I have Php 4.0.6 on Linux with Informix Dynamic Server 7.31.UD1.
I try to use the function ifx_num_rows after afx_query and the value
returned is always 0,  but i can see
the result with ifx_fetch_row.
Does Anyone know if there is a bug with this function ifx_num_rows ?

Thanks in advance.
Leila



-- 
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 Paul Burney

on 6/21/01 2:23 PM, wflow at [EMAIL PROTECTED] wrote:

 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'.

 does NOT return an enumerated array, as the top line of the page states. It
 ONLY returns an associative array.
 If there was an ifx_fetch_array like the one for MySQL, I would not have to
 even post this question.

Please Note:  I don't use Informix, but the following is an educated guess.

Even though it isn't an enumerated array, you should be able to get the
value using the name of the key.  For example, to set your new query, you
would have something like:

/* DB Connect stuff precedes this as in example on:
http://php.net/manual/en/function.ifx-fetch-row.php */

while ifx_fetch_row($rid) {

$my_new_query =
'SELECT * FROM shipping WHERE orderdate = ' . $row['orderdate'] . '';

/* Now, take that query and do something with it.  Call ifx_query or
 something.*/

}

You could also just go through all the results in a similar fashion and set:

$orderdate = $row['orderdate'];
$ordertotal = $row['ordertotal'];

Hope that helps.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



-- 
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 Paul Gardiner

Hi,

Have a try with something like this. Not tested and it's Friday ;o)

$connid = ifx_connect(blah,blah,blah) or
  die(An error occurred connecting to database);

$Query = SELECT tracknum,orderdate,ordertotal,status,shipdate .
FROM orders .
WHERE tracknum = '$trknum' ;

$rid = ifx_query($Query, $connid, IFX_SCROLL) or
 die(An error occurred querying database);

$row = ifx_fetch_row($rid, NEXT);

$orderdate = $row['orderdate'];

$Query = SELECT stuff .
FROM somewhere .
WHERE orderdate = '$orderdate' ;


$rid = ifx_query($Query, $connid, IFX_SCROLL) or
 die(An error occurred querying database);

@ifx_htmltbl_result($rid,border=1);

ifx_free_result ($rid);

ifx_close($connid);

Regards,
- Paul -

- Original Message -
From: wflow [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 21, 2001 10:23 PM
Subject: Re: [PHP-DB] Informix Question (Still need help,please)


 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 there was an ifx_fetch_array like the one for MySQL, I would not have
to
 even post this question.

 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.



 B

 Christian Haul [EMAIL PROTECTED] wrote in message
 9gsg0u$6nf$[EMAIL PROTECTED]">news:9gsg0u$6nf$[EMAIL PROTECTED]...
  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 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 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 (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 Dan Fitzpatrick

B,

Do your first query, then run this (for one record returned).

while($row = ifx_fetch_row($query_result_id)) {
for(reset($row); $fieldname=key($row); next($row)) {
$$fieldname = $row[$fieldname]; 
}
}

Do your second query.

The while statement will set each field value equal to the field name.

Dan

  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'.


-- 
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-22 Thread Mark Roedel

 -Original Message-
 From: Bård Farstad [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 19, 2001 11:45 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Informix question
 
 
 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?

I just got back from a conference for some software we use that's
Informix-driven, and it was mentioned in one of the sessions that
there's a setting to enable this *if* you're using Informix 11.x (we're
still on 9.x here).

The speaker didn't know the setting off the top of his head, but
indicated it was in Informix's online documentation, searchable at

http://www.informix.com/answers/


---
Mark Roedel ([EMAIL PROTECTED])  ||  There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full.
 LeTourneau University  ||-- Henry Kissinger


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




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

2001-06-21 Thread wflow

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 there was an ifx_fetch_array like the one for MySQL, I would not have to
even post this question.

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.



B

Christian Haul [EMAIL PROTECTED] wrote in message
9gsg0u$6nf$[EMAIL PROTECTED]">news:9gsg0u$6nf$[EMAIL PROTECTED]...
 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 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 Question how to put data from query into variables

2001-06-20 Thread wflow

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'.

HTML

!-- doit.php --BODY

H1Please enter your Tracking Number: /H1


FORM action=http://sqa/doit.php;

INPUT NAME=trknum BR

INPUT type = submit value = Execute

/FORM

/BODY



?php

define(DBG,1);

$connection = ifx_connect(fra3x@ol_unit,foo,bar)

or die(Couldn't create connection.);

$sql = select tracknum,orderdate,ordertotal,status,shipdate from orders
where tracknum = '$trknum';

$sql_result = ifx_query($sql,$connection);

@ifx_htmltbl_result($sql_result,border=1);

ifx_free_result($sql_result);

ifx_close($connection);

ifx_close();}

?






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


[PHP-DB] Informix question

2001-06-19 Thread Bård Farstad

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?

I'm using:

-- 
Bård Farstad
Systems developer
ez.no | developer.ez.no | zez.org

-- 
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 user wierdness

2001-03-31 Thread Graeme Merrall

This is more an Informix question rather than a PHP question but I hope
someone can help
I've installed the Linux-SE version and CSDK of Informix from informix.com
and installation has gone fine including createing the demo DB. I can also
start 'dbaccess' and browse/query the tables so the envvars seem fine.

However, when I endeavour to use the PHP functions, I get an error in
ifx_connect()
I constantly get the error:
E [SQLSTATE=IX 000 SQLCODE=-952]
User ()'s password is not correct for the database server.

Note how the username field is empty. What's the procedure for 'logging in'
to the DB? I created the demo DB as a normal user and I've read that the
user auth stuff is done through the operating system.
Using 'dbaccess' to try and connect to the DB as the same user rather then
starting dbaccess in the DB dir causes the same error to occur so it's
obviously something in the setup.

My sqlhosts line is 'demo_se seipcpipdev sqlexec'
and the ifx_connect line is 'ifx_connect("stores7@demo_se", "testuser",
"mypasswd")'

Cheers,
 Graeme


-- 
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 client sdk for linux

2001-03-14 Thread Marios Moutzouris

Hello

Anybody know where i can get hold of this. Informix site at
www.informix.com/evaluate..has for every OS other than
Linux

Thanks
Marios


-- 
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: inserting long chars via php3

2001-02-12 Thread Udo Oehmig

hi,

we work with php 3.0.14 and try to insert texts into char(500) fields in an
informix 7.2 database. but, there is always the following error:

"Warning: Prepare fails (E [SQLSTATE=IX 000 SQLCODE=-280]) in db.inc.php3 on
line 21"

that error code -280 means: "A qouted string exceeds 256 bytes"

i tried the same thing with informix 4gl - and it was possible to have a
quoted string longer than 256 bytes...

does anyone know this problem? could it be solved? is it a problem of the
php informix driver or a problem of the database erver?

thanx

-udo


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