[PHP-DB] Help wanted, Writing to the LPT Port.

2005-04-21 Thread JB
Hello,

I want to write a switch board in PHP. So that it is possible to write data 
1 or 0 to the D0 - D7. So that It is possible to switch a relais wich I 
connected to the LPT port of my webserver.

I could not find any examples or documentation on this theme.

Could somebody help me with this problem?

P.S. I am sure that it is possible because it is also possible to print with 
PHP. So why should we not be able to write a specific value to the LPT port. 
I saw 1 example with a serial port. So.

Kind regards,

J Bosch 


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



[PHP-DB] Help wanted, writing to a LPT port with PHP.

2005-04-21 Thread CNFPC
Hello,
I want to write a switch board in PHP. So that it is possible to write data
1 or 0 to the D0 - D7. So that It is possible to switch a relais wich I
connected to the LPT port of my webserver.
I could not find any examples or documentation on this theme.
Could somebody help me with this problem?
P.S. I am sure that it is possible because it is also possible to print 
with
PHP. So why should we not be able to write a specific value to the LPT 
port.
I saw 1 example with a serial port. So.

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


[PHP-DB] mixing charactersets

2005-04-21 Thread Juffermans, Jos
Hi,

I have a script that needs to connect to two database. Unfortunately, one of
them uses US7ASCII encoding (similar to LATIN1) and the other one uses UTF-8
encoding.

Before I connect to the first one, I set these environment variables:

putenv(NLS_LANG=AMERICAN_AMERICA.US7ASCII);
putenv(NLS_CHARACTERSET=US7ASCII);

and before I connect to the second one, I set these environment variables:

putenv(NLS_LANG=AMERICAN_AMERICA.UTF8);
putenv(NLS_CHARACTERSET=UTF8);

I have noticed that once you have set the environment, it ignores (or seems
to ignore anyway) the second one. I have tried to set the environment each
time just before I connect and also just before I do a query, but that
doesn't make a difference.

If I don't set the characterset to US7ASCII before I retrieve data from the
first database, I get garbage data from the query. If I don't set the
characterset to UTF-8 before I store data to the second database, it stores
garbage.

How can I use those two databases in one script?

Jos

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



[PHP-DB]MYSQL

2005-04-21 Thread Ong Teng Siong
I am using mysql 4.1 and php 5.0 in my WINDOWS XP. I
am trying to use it. But, this error msg eccurs.

Fatal error: Call to undefined function
mysqli_connect() in c:\Inetpub\wwwroot\mysql_up.php

Anyone can help me?

Thank you.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP-DB]MYSQL

2005-04-21 Thread Petar Nedyalkov
On Thursday 21 April 2005 13:41, Ong Teng Siong wrote:
 I am using mysql 4.1 and php 5.0 in my WINDOWS XP. I
 am trying to use it. But, this error msg eccurs.

 Fatal error: Call to undefined function
 mysqli_connect() in c:\Inetpub\wwwroot\mysql_up.php

Your PHP installation does not support the mysqli extension.
Install PHP with mysqli support.


 Anyone can help me?

 Thank you.

 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

-- 

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436


pgp3t4pTjPYok.pgp
Description: PGP signature


Re: [PHP-DB] Losing the ability to connect to Oracle database

2005-04-21 Thread Leo D. Geoffrion
It worked!
I did not need to restart apache this morning in order to get an oracle 
connection.

Michael Caplan wrote:
Leo,
Please let me know how that works for you.  I don't remember the specifics
(if we where testing using plogon, nlogon or just logon), but we did try and
implement that fix and it didn't work for us.  

Thanks,
Michael
-Original Message-
From: Leo D. Geoffrion [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 20, 2005 6:03 AM
To: Michael Caplan
Subject: Re: [PHP-DB] Losing the ability to connect to Oracle database

Yes, I just found 30808.  It's suspended because the fix is stated in 
the discussion (uncomment out a small section of oci8.c), but for 
performance reasons they don't want to make this part of the standard code.

I've rebuilt php5 now with the change in place and will see if this 
fixes the problem for my systems.  I can confirm that it's at least 
harmless.

Michael Caplan wrote:

Hi Leo,
We are having the same problem.  Check out the bug I filed many months ago
http://bugs.php.net/bug.php?id=30808  I can't for the life of me figure out
why the bug is suspended, as this seems to be a common issue with Oracle
and
php5.  Perhaps you should also and your comments to the bug report.
To resolve the issue, we do an apache restart every time the db goes
down.
This flushes whatever connections php pools to Oracle (sounds weird
considering we are doing oci8nlogon).
I really hope that the OCI8 library gets some serious attention soon.  In
my
mind this is a show stopper, and it appears that there are a few other big
ones lying around...
Michael
-Original Message-
From: Leo D. Geoffrion [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 8:27 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Losing the ability to connect to Oracle database

I recently upgraded to PHP5 and now have a curious Oracle problem.
The PHP scripts query the database fine.  Then overnight, the database 
shuts down for backup and restarts.  The next day, PHP can no longer 
connect to the database until I restart Apache.  Then, it's happy until 
Oracle restarts the next night.

We did not encounter this problem with PHP4.
I've tried adjusting the php command from the old ocilogon() to 
oci_connect() but the problem continues.  Incidentally, I am using a 
simple connection, not a persistent one.

Can someone advise what's wrong here or how to get PHP/Apache to survive 
a database restart.



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


Re: [PHP-DB] Losing the ability to connect to Oracle database

2005-04-21 Thread Leo D. Geoffrion
The patch described in 30808 worked fine last night.
Leo D. Geoffrion wrote:
Turns out that it's covered in bug report 30808.
I've applied the edit mentioned there and will see if this solves my 
problem (have to wait for the next Oracle restart overnight).

The discussion there is quite revealing about the fact that oci8 
connections are always persistent even if you do not ask for a 
persistent connect of explicitly call for a disconnect.

Seems to me that ought to be stated in the oci8 documentation.
Christopher Jones wrote:
Leo D. Geoffrion wrote:
I recently upgraded to PHP5 and now have a curious Oracle problem.
The PHP scripts query the database fine.  Then overnight, the 
database shuts down for backup and restarts.  The next day, PHP can 
no longer connect to the database until I restart Apache.  Then, it's 
happy until Oracle restarts the next night.

We did not encounter this problem with PHP4.
I've tried adjusting the php command from the old ocilogon() to 
oci_connect() but the problem continues.  Incidentally, I am using a 
simple connection, not a persistent one.

Can someone advise what's wrong here or how to get PHP/Apache to 
survive a database restart.

There were some changes to connection in PHP5.  I guess this might be a
symptom, but I recall similar things reported with PHP4.  Can you log 
a PHP
bug so the problem can be tracked?

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


[PHP-DB] MySQL query + PHP : Warning: implode() [function.implode]: Bad arguments : What's wrong here?

2005-04-21 Thread jinxed
I have 2 tables employees  transactions. 'employees' carry info about the 
employees and transactions carry there payslip info for each period.
I am trying to display a list of employees that don't have transactions in 
the current ($pp_id) period,
thus doing an array of the $emp_ids, having transactions in the current 
period
in order to exclude them in the next query.
I am using MySQL 4.1.11
Any help will be appreciated.

$pp_id = $_GET['pp_id'];
$t1 = employees;
$t2 = transactions;
$query = mysql_query(SELECT  `emp_id` FROM $t2 WHERE `pp_id` = '$pp_id');
while ($row = @mysql_fetch_array($query)){
$emp_ids=$row['emp_id'];
}

line 83:$select_employee_query = mysql_query( SELECT $t1.* FROM $t1 
WHERE emp_id IN ( . implode(', ', $emp_ids) . ) );
   while ($row = @mysql_fetch_array($select_employee_query)) 
{
$var3=$row['emp_num'];
$var4=$row['emp_title'];
$var5=$row['emp_initials'];
$var6=$row['emp_surname'];

echo $var3 $var4 $var5 $var6;
}

  Warning: implode() [function.implode]: Bad arguments. in 
../add_payslip1.php on line 83
 

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



[PHP-DB] mime-type related to extension?

2005-04-21 Thread mel list_php
Hi guys!
I have a basic form to upload files, my problem is about the mime type.
I use $type= $_FILES[$file_uploaded]['type']; to check the mime-type of the 
fila as I want to allow only .jpeg.
I have then a test like:
if  ($type==image/pjpeg || $type==image/jpeg)
{
...
}

Upload working fine if I send red.jpg.
However if I rename the file in red, php recognizes it as 
application/octet-stream and not jpeg.
I'm working under linux and for me the extension is not required for a file, 
I thought the mime-type was encoded in the file itself and was independent 
of the extension.
Any clue on that?
Any other php function I should look at?
The cookbook and pear both use $_FILES[ ] ['type'] so I have no idea here.

Thanks,
Melanie
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

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


[PHP-DB] Can not insert local language data into db

2005-04-21 Thread JohnyG
Hi,
I installed phpbb forum application on commercial server (brinkster.com)
with mySql as database.
You can see the application here:
http://www.adeo.co.il/forum/

When i try to insert English characters everythink works fine
but when i try to insert Hebrew (my local language) characters
weird signs appear (you can see in the link above).
When i look inside the Db the hebrew data is also seen as weird characters.

What might cause this?
doesn't php and mySql use unicode?
How can i fix this?

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



[PHP-DB] Can not insert local language data into db

2005-04-21 Thread JohnyG

Hi,
I installed phpbb forum application on commercial server (brinkster.com)
with mySql as database.
You can see the application here:
http://www.adeo.co.il/forum/

When i try to insert English characters everythink works fine
but when i try to insert Hebrew (my local language) characters
weird signs appear (you can see in the link above).
When i look inside the Db the hebrew data is also seen as weird characters.

What might cause this?
doesn't php and mySql use unicode?
How can i fix this?

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