Re: [PHP-DB] Re: ORA-01460 error when useing bind sql on oracle from php

2003-12-15 Thread Christopher Jones
Using OCIBindByName($stmt,$bindname,${bindval$ci},-1); probably gives
a warning that call-time pass-by-reference has been deprecated.
The OCIBindByName manual entry at 
http://www.php.net/manual/en/function.ocibindbyname.php
has a user comment from alexander dot zimmer at gmx dot at that this doesn't work:
  foreach ($array as $key = $val)
  {
OCIBindByName($state, $key, $val, -1);
  }
but that this does:

  foreach ($array as $key = $val)
  {
OCIBindByName($state, $key, $array[$key], -1);
  }
See the entry in the manual page for the explanation.

Chris

Are Pedersen wrote:
 Problem solved!

As OCIBindByName is binding to the actual variable, that variable must 
not be changed.

I modified my script to look like this:
---***---
$ci=0;
foreach ($bindargs as $bindname = $bindvalue){
  ${bindval$ci}=$bindvalue;
  OCIBindByName($stmt,$bindname,${bindval$ci},-1);
  $ci++;
}
---***---
Are Pedersen wrote:

I get ORA-01460: unimplemented or unreasonable conversion requested 
when useing bind-sql on Oracle 9i.
I am useing OCI 8.1 client in PHP.

What is wrong? And what does this message mean?

Here is the code:
---***---
$bindarray1=array(':project1'=$project);
$bindarray1[':userid']=$userid;
$rs = sql_query($qs,$bindarray1);
function sql_query($qs,$bindargs) {
  $stmt = @OCIParse($this-db_sqlhandler, $qs);
  if (!$stmt) {
return false;
  }
  //bind all the variables
  if (is_array($bindargs)){
foreach ($bindargs as $bindname = $bindvalue){
  OCIBindByName($stmt,$bindname,$bindvalue,-1);
}
  }
  if (@OCIExecute($stmt)) {
return $stmt;
  }
  $DB_ERROR = OCIError($stmt);
  return $DB_ERROR;
}
---***---
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Problem with PHP_AUTH_USER

2003-12-15 Thread Constantin Brinzoi
Hi!

Here is the problem:

How can I unset the $PHP_AUTH_USER when the user clicks logout?

The authentication works very well except the log out.
I tried:
session_destroy(); 
unset($_SERVER['PHP_AUTH_USER'])

and in the next line I did:

print $PHP_AUTH_USER;

and the value is still there.

How can I unregister this variable so that the authentication window
appears again.

I'm using apache 2.0.40, php 4.2.2 compiled as a module, RedHat Linux
9.0. Register globals is On.

TIA
Constantin Brinzoi.

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



[PHP-DB] Re: Dreamweaver as PHP editor

2003-12-15 Thread Massimo Foti
Susi Sloan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm just getting into PHP, and have found that as a PHP code editor,
 Dreamweaver works pretty well (with the extension I installed). My
question
 is this, whenever I save an include file with the .inc extension, all of
the
 color coding goes away, as does the PHP tab on the tool bar. Is there any
 way to make Dreamweaver see a .inc file as a PHP file? I looked on all the
 menus and in the preferences, but I couldn't find an obvious way to do
this.

Sorry for the late reply:

http://www.macromedia.com/support/dreamweaver/ts/documents/add_ext_mx.htm

Massimo

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



[PHP-DB] Another question

2003-12-15 Thread Constantin Brinzoi
Is there a php function that closes a browser window?

I know there is a javascript function (window.close), but I can't use it
because it complains that the window is not opened by javascript
(window.open).

I looked over the function reference but I didn't find anything about
this problem.

TIA
Constantin Brinzoi

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



RE: [PHP-DB] Another question

2003-12-15 Thread Mike U. Petrov
I think no. IMHO PHP can't have effect on user's programs. If I'm not right
correct me.
But window.close can close window opened not by javascript. It just ask user
is he want to close or no.

Mike U. Petrov
PHP-programmer.

-Original Message-
From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 3:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Another question


Is there a php function that closes a browser window?

I know there is a javascript function (window.close), but I can't use it
because it complains that the window is not opened by javascript
(window.open).

I looked over the function reference but I didn't find anything about
this problem.

TIA
Constantin Brinzoi

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



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



RE: [PHP-DB] Another question

2003-12-15 Thread Duane Lakoduk

You can avoid the prompt when using javascript to close the window if you
use this:

function closeit(){
window.opener = top;
window.close();
}

Now, window will close without prompting.

hth,

Duane
 -Original Message-
 From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 6:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Another question


 Is there a php function that closes a browser window?

 I know there is a javascript function (window.close), but I
 can't use it
 because it complains that the window is not opened by javascript
 (window.open).

 I looked over the function reference but I didn't find anything about
 this problem.

 TIA
 Constantin Brinzoi



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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
Really?
What is the reason for that?...

Muhammed.

- Original Message - 
From: Duane Lakoduk [EMAIL PROTECTED]
To: 'Constantin Brinzoi' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 3:17 PM
Subject: RE: [PHP-DB] Another question


 
 You can avoid the prompt when using javascript to close the window if you
 use this:
 
 function closeit(){
 window.opener = top;
 window.close();
 }
 
 Now, window will close without prompting.
 
 hth,
 
 Duane
  -Original Message-
  From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
  Sent: Monday, December 15, 2003 6:15 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Another question
 
 
  Is there a php function that closes a browser window?
 
  I know there is a javascript function (window.close), but I
  can't use it
  because it complains that the window is not opened by javascript
  (window.open).
 
  I looked over the function reference but I didn't find anything about
  this problem.
 
  TIA
  Constantin Brinzoi
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



RE: [PHP-DB] Another question

2003-12-15 Thread Mike U. Petrov
I've tried to use this function, but it doesn't work on IE 5.0
On Opera 7.21 it works.
So on what browser you've tested it?

Mike U. Petrov


-Original Message-
From: Duane Lakoduk [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 4:18 PM
To: 'Constantin Brinzoi'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Another question



You can avoid the prompt when using javascript to close the window if you
use this:

function closeit(){
window.opener = top;
window.close();
}

Now, window will close without prompting.

hth,

Duane
 -Original Message-
 From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 6:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Another question


 Is there a php function that closes a browser window?

 I know there is a javascript function (window.close), but I
 can't use it
 because it complains that the window is not opened by javascript
 (window.open).

 I looked over the function reference but I didn't find anything about
 this problem.

 TIA
 Constantin Brinzoi



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



RE: [PHP-DB] Another question

2003-12-15 Thread Duane Lakoduk
In I.E. 5.5 and newer. 

 -Original Message-
 From: Mike U. Petrov [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 7:32 AM
 To: [EMAIL PROTECTED]; 'Constantin Brinzoi'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Another question
 
 
 I've tried to use this function, but it doesn't work on IE 5.0
 On Opera 7.21 it works.
 So on what browser you've tested it?
 
 Mike U. Petrov
 
 
 -Original Message-
 From: Duane Lakoduk [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 4:18 PM
 To: 'Constantin Brinzoi'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Another question
 
 
 
 You can avoid the prompt when using javascript to close the 
 window if you
 use this:
 
 function closeit(){
   window.opener = top;
   window.close();
 }
 
 Now, window will close without prompting.
 
 hth,
 
 Duane
  -Original Message-
  From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
  Sent: Monday, December 15, 2003 6:15 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Another question
 
 
  Is there a php function that closes a browser window?
 
  I know there is a javascript function (window.close), but I
  can't use it
  because it complains that the window is not opened by javascript
  (window.open).
 
  I looked over the function reference but I didn't find 
 anything about
  this problem.
 
  TIA
  Constantin Brinzoi
 
 
 
 -- 
 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



RE: [PHP-DB] Another question

2003-12-15 Thread Duane Lakoduk
This works because you have assigned a name to the .opener property which is
blank when you open a browser without script.  Script is now satisfied that
window was opened by script.

 -Original Message-
 From: Muhammed Mamedov [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 7:26 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Another question


 Really?
 What is the reason for that?...

 Muhammed.

 - Original Message -
 From: Duane Lakoduk [EMAIL PROTECTED]
 To: 'Constantin Brinzoi' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 3:17 PM
 Subject: RE: [PHP-DB] Another question


 
  You can avoid the prompt when using javascript to close the
 window if you
  use this:
 
  function closeit(){
  window.opener = top;
  window.close();
  }
 
  Now, window will close without prompting.
 
  hth,
 
  Duane
   -Original Message-
   From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
   Sent: Monday, December 15, 2003 6:15 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DB] Another question
  
  
   Is there a php function that closes a browser window?
  
   I know there is a javascript function (window.close), but I
   can't use it
   because it complains that the window is not opened by javascript
   (window.open).
  
   I looked over the function reference but I didn't find
 anything about
   this problem.
  
   TIA
   Constantin Brinzoi
  
  
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
Could you provide the code you use for destroying your session?

Because if you destroy it session_unregister($session_name) then no need
for browser closing.
But if you don't destroy it, then it will be destroyed automatically after
you close the browser.. this is how PHP works.

Regards,
Muhammed.


- Original Message - 
From: Constantin Brinzoi [EMAIL PROTECTED]
To: Muhammed Mamedov [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 4:05 PM
Subject: Re: [PHP-DB] Another question


 The reason is that I want to logout from the system.
 I destroyed the session but the session is still there!
 So I'm thinking of closing the window for good!

 Do you have any ideas how to make it work?

 Aurel.

 On Mon, 2003-12-15 at 15:25, Muhammed Mamedov wrote:
  Really?
  What is the reason for that?...
 
  Muhammed.
 
  - Original Message - 
  From: Duane Lakoduk [EMAIL PROTECTED]
  To: 'Constantin Brinzoi' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, December 15, 2003 3:17 PM
  Subject: RE: [PHP-DB] Another question
 
 
  
   You can avoid the prompt when using javascript to close the window if
you
   use this:
  
   function closeit(){
   window.opener = top;
   window.close();
   }
  
   Now, window will close without prompting.
  
   hth,
  
   Duane
-Original Message-
From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Another question
   
   
Is there a php function that closes a browser window?
   
I know there is a javascript function (window.close), but I
can't use it
because it complains that the window is not opened by javascript
(window.open).
   
I looked over the function reference but I didn't find anything
about
this problem.
   
TIA
Constantin Brinzoi
   
   
  
   -- 
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Constantin Brinzoi
I destroy the session with:
session_destroy()

The file is deleted from the /tmp directory (which is good) but after
that I want to go on another page (public space) and get rid of
PHP_AUTH_USER and PHP_AUTH_PW.

How can I do it?

On Mon, 2003-12-15 at 16:10, Muhammed Mamedov wrote:
 Could you provide the code you use for destroying your session?
 
 Because if you destroy it session_unregister($session_name) then no need
 for browser closing.
 But if you don't destroy it, then it will be destroyed automatically after
 you close the browser.. this is how PHP works.
 
 Regards,
 Muhammed.
 
 
 - Original Message - 
 From: Constantin Brinzoi [EMAIL PROTECTED]
 To: Muhammed Mamedov [EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 4:05 PM
 Subject: Re: [PHP-DB] Another question
 
 
  The reason is that I want to logout from the system.
  I destroyed the session but the session is still there!
  So I'm thinking of closing the window for good!
 
  Do you have any ideas how to make it work?
 
  Aurel.
 
  On Mon, 2003-12-15 at 15:25, Muhammed Mamedov wrote:
   Really?
   What is the reason for that?...
  
   Muhammed.
  
   - Original Message - 
   From: Duane Lakoduk [EMAIL PROTECTED]
   To: 'Constantin Brinzoi' [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Monday, December 15, 2003 3:17 PM
   Subject: RE: [PHP-DB] Another question
  
  
   
You can avoid the prompt when using javascript to close the window if
 you
use this:
   
function closeit(){
window.opener = top;
window.close();
}
   
Now, window will close without prompting.
   
hth,
   
Duane
 -Original Message-
 From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 15, 2003 6:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Another question


 Is there a php function that closes a browser window?

 I know there is a javascript function (window.close), but I
 can't use it
 because it complains that the window is not opened by javascript
 (window.open).

 I looked over the function reference but I didn't find anything
 about
 this problem.

 TIA
 Constantin Brinzoi


   
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
   ---
   Outgoing mail is certified Virus Free.
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
 
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
I see.

You use something like this right?

 header('WWW-Authenticate: Basic realm=My Realm');
 header('HTTP/1.0 401 Unauthorized');

and of course want to get rid of PHP_AUTH_USER and PHP_AUTH_PW variables
which are then return.
Well..this is something different than the session. If you look at PHP
documentation these are represented as globals. So most probably you will
have to unset() them (using $Global['var_name'] maybe .?)


M.Mamedov

- Original Message - 
From: Constantin Brinzoi [EMAIL PROTECTED]
To: Muhammed Mamedov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 4:13 PM
Subject: Re: [PHP-DB] Another question


 I destroy the session with:
 session_destroy()

 The file is deleted from the /tmp directory (which is good) but after
 that I want to go on another page (public space) and get rid of
 PHP_AUTH_USER and PHP_AUTH_PW.

 How can I do it?

 On Mon, 2003-12-15 at 16:10, Muhammed Mamedov wrote:
  Could you provide the code you use for destroying your session?
 
  Because if you destroy it session_unregister($session_name) then no
need
  for browser closing.
  But if you don't destroy it, then it will be destroyed automatically
after
  you close the browser.. this is how PHP works.
 
  Regards,
  Muhammed.
 
 
  - Original Message - 
  From: Constantin Brinzoi [EMAIL PROTECTED]
  To: Muhammed Mamedov [EMAIL PROTECTED]
  Sent: Monday, December 15, 2003 4:05 PM
  Subject: Re: [PHP-DB] Another question
 
 
   The reason is that I want to logout from the system.
   I destroyed the session but the session is still there!
   So I'm thinking of closing the window for good!
  
   Do you have any ideas how to make it work?
  
   Aurel.
  
   On Mon, 2003-12-15 at 15:25, Muhammed Mamedov wrote:
Really?
What is the reason for that?...
   
Muhammed.
   
- Original Message - 
From: Duane Lakoduk [EMAIL PROTECTED]
To: 'Constantin Brinzoi' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 3:17 PM
Subject: RE: [PHP-DB] Another question
   
   

 You can avoid the prompt when using javascript to close the window
if
  you
 use this:

 function closeit(){
 window.opener = top;
 window.close();
 }

 Now, window will close without prompting.

 hth,

 Duane
  -Original Message-
  From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
  Sent: Monday, December 15, 2003 6:15 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Another question
 
 
  Is there a php function that closes a browser window?
 
  I know there is a javascript function (window.close), but I
  can't use it
  because it complains that the window is not opened by javascript
  (window.open).
 
  I looked over the function reference but I didn't find anything
  about
  this problem.
 
  TIA
  Constantin Brinzoi
 
 

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

   
   
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
  
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



[PHP-DB] Re: php mail() question

2003-12-15 Thread Manuel Lemos
Hello,

On 12/14/2003 11:51 PM, Jerry wrote:
Php mail() question.

I use php mail() frequently, dragging data from a
mysql database.  I am not sure if this is possible but
thought I'd throw it on this board.
in php mail() function you can set a return_address
etc.  Is it possible to change this and run a query? 
I mean if the email bounces can it somehow talk back
to php mail() and do a query rather than send it to
the return_address?
If you make the bounce address point to a POP3 mailbox, you have a 
platform independent solution to handle bounces. Then you just need to 
use some POP3 component like this to fetch and process the bounced 
messages once in a while, for instance starting a PHP script from a cron 
task. I do this all the time to handle bounces from newsletters that I 
send from my site.

http://www.phpclasses.org/pop3class

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread Adam i Agnieszka Gasiorowski FNORD

I cannot use this query

CREATE TABLE table LIKE other_table;

, which is supposed to create an
 empty clone of the other_table named
 table.
Was it added in some later MySQL version?
 It's in the manual on mysql.com, bo no version info
 available.

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



RE: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread Gary Every
Try:
CREATE table new_table SELECT * from old_table limit 1;

delete from new_table;

This will give you the same structure in both tables, and the deletion will make the 
new_table empty.



-Original Message-
From: Adam i Agnieszka Gasiorowski FNORD [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 10:28 AM
To: Lista PHP DB
Subject: [PHP-DB] CREATE TABLE LIKE, error



I cannot use this query

CREATE TABLE table LIKE other_table;

, which is supposed to create an
 empty clone of the other_table named
 table.
Was it added in some later MySQL version?
 It's in the manual on mysql.com, bo no version info
 available.

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread CPT John W. Holmes
From: Adam i Agnieszka Gasiorowski FNORD [EMAIL PROTECTED]

 I cannot use this query

 CREATE TABLE table LIKE other_table;

 , which is supposed to create an
  empty clone of the other_table named
  table.
 Was it added in some later MySQL version?
  It's in the manual on mysql.com, bo no version info
  available.

Sure there is, you just had to keep reading.

Quote:
In MySQL 4.1, you can also use LIKE to create a table based on the
definition of another table, including any column attributes and indexes the
original table has:

CREATE TABLE new_tbl LIKE orig_tbl;
CREATE TABLE ... LIKE does not copy any DATA DIRECTORY or INDEX DIRECTORY
table options that were specified for the original table.



Since this is a PHP list, an alternative, two-step method is to issue a SHOW
CREATE TABLE Table_Name query, retrieve the results, and use them to create
your second table (replacing the table name, of course).

---John Holmes...

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



Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread CPT John W. Holmes
From: Gary Every [EMAIL PROTECTED]


 Try:
 CREATE table new_table SELECT * from old_table limit 1;
 
 delete from new_table;
 
 This will give you the same structure in both tables, and the 
 deletion will make the new_table empty.

Not quite the same as it will not copy indexes/keys...

---John Holmes...

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



Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread Adam i Agnieszka Gasiorowski FNORD
CPT John W. Holmes wrote:
 
 From: Adam i Agnieszka Gasiorowski FNORD [EMAIL PROTECTED]
 
  I cannot use this query
 
  CREATE TABLE table LIKE other_table;
 
  , which is supposed to create an
   empty clone of the other_table named
   table.
  Was it added in some later MySQL version?
   It's in the manual on mysql.com, bo no version info
   available.
 
 Sure there is, you just had to keep reading.
 
 Quote:
 In MySQL 4.1, you can also use LIKE to create a table based on the
 definition of another table, including any column attributes and indexes the
 original table has:

Ah, I missed it. Do you know what is
 an estimate for 4.1 to go stable?
 
 CREATE TABLE new_tbl LIKE orig_tbl;
 CREATE TABLE ... LIKE does not copy any DATA DIRECTORY or INDEX DIRECTORY
 table options that were specified for the original table.
 
 Since this is a PHP list, an alternative, two-step method is to issue a SHOW
 CREATE TABLE Table_Name query, retrieve the results, and use them to create
 your second table (replacing the table name, of course).

Thank you very much.

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



[PHP-DB] Finding duplicate values between several tables and appending this to a new table.

2003-12-15 Thread Norman Khine
Hello,
I have a database that has several tables, such as Company Name,
Address, Region, Employees.

I also have a table that contains similar sort of information as in the
first database, but this table has not been properly structured and just
contains a a record for each and every employee. It's a flat text file.

Now my question is there a way to compare the Company Name table,
against the Company Name field in the second table?

If there is,can you please provide me with basic examples so that I can
understand the principles, on how to do this?

Cheers

Norman

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



[PHP-DB] sql errors?

2003-12-15 Thread Jas
I have checked and rechecked my code on these php to mysql statements 
and for some reason I either get no data (through php, where through a 
command line I get all the data I need) or errors on the update 
function.  Could someone tell me what I am doing wrong?

$sql = mysql_query(SELECT hostname FROM $table WHERE vlan = 
$_POST[dhcp_hosts],$db)or die(mysql_error());

from the command line
SELECT hostname FROM hosts WHERE vlan = 'Vlan-22';
And I get results... I don't get it.

And for the update statement I am having problems with...
$sql_global = mysql_query(UPDATE $tble SET dn = '$_POST[dn]' SET lt = 
'$_POST[lt]' SET mlt = '$_POST[mlt]' SET msc01 = '$_POST[msc01]' SET 
msc02 = '$_POST[msc02]' SET msc03 = '$_POST[msc03]' SET msc04 = 
'$_POST[msc04]' WHERE id = '1',$db)or die(mysql_error());

If you echo the posted vars they are all present and the same statement 
works in other places of the script and from the command line.

Any help is appreciated.
Jas
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] sql errors?

2003-12-15 Thread Tobey Wheelock
On Mon, Dec 15, 2003 at 03:49:31PM -0700, Jas wrote:
 $sql = mysql_query(SELECT hostname FROM $table WHERE vlan = 
 $_POST[dhcp_hosts],$db)or die(mysql_error());

Maybe like this?

$sql = mysql_query(SELECT hostname FROM $table WHERE vlan = '.
$_POST[dhcp_hosts].',$db)or die(mysql_error());

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



[PHP-DB] how to build php_oci8.dll

2003-12-15 Thread Liujin Yu
Hi,

I downloaded php binary distribution for windows and installed and made
it work with my Apache server.

However, after I enabled the php_oci8.dll in php.ini, my Apache server
crashed. I guess the library or the header files php_oci8.dll compiled
with does not match the ones I have here.

May I know how to build this dll?

Thanks!

Liujin

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

[PHP-DB] Re: php mail() question

2003-12-15 Thread JeRRy
Hi,

Thanks for that.  That's hitting the nail right on the
head.

But I need a bit of PHP code to talk to mysql and only
read the from part of the email and use a query to
check the database if the entry is there.  If it is
than flag it, if not skip it and delete the email.

So would I need to edit the code to make the from
section a input form or can I somehow get a query to
get the from data from plain text?

All I want is the from address, the rest I don't
really need.

So

UPDATE users SET flag='y' WHERE email='$from_address';

Might even output something to make sure it was
sucessful or not.

What I need to know is how I get the from address?

Jerry

 --- Manuel Lemos [EMAIL PROTECTED] wrote:  Hello,
 
 On 12/14/2003 11:51 PM, Jerry wrote:
  Php mail() question.
  
  I use php mail() frequently, dragging data from a
  mysql database.  I am not sure if this is possible
 but
  thought I'd throw it on this board.
  
  in php mail() function you can set a
 return_address
  etc.  Is it possible to change this and run a
 query? 
  I mean if the email bounces can it somehow talk
 back
  to php mail() and do a query rather than send it
 to
  the return_address?
 
 If you make the bounce address point to a POP3
 mailbox, you have a 
 platform independent solution to handle bounces.
 Then you just need to 
 use some POP3 component like this to fetch and
 process the bounced 
 messages once in a while, for instance starting a
 PHP script from a cron 
 task. I do this all the time to handle bounces from
 newsletters that I 
 send from my site.
 
 http://www.phpclasses.org/pop3class
 
 -- 
 
 Regards,
 Manuel Lemos
 
 Free ready to use OOP components written in PHP
 http://www.phpclasses.org/
  

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

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



[PHP-DB] Re: php mail() question

2003-12-15 Thread Manuel Lemos
Hello,

On 12/15/2003 10:23 PM, Jerry wrote:
Thanks for that.  That's hitting the nail right on the
head.
But I need a bit of PHP code to talk to mysql and only
read the from part of the email and use a query to
check the database if the entry is there.  If it is
than flag it, if not skip it and delete the email.
So would I need to edit the code to make the from
section a input form or can I somehow get a query to
get the from data from plain text?
All I want is the from address, the rest I don't
really need.
So

UPDATE users SET flag='y' WHERE email='$from_address';

Might even output something to make sure it was
sucessful or not.
What I need to know is how I get the from address?
That's tricky. What I do is to have a catch-all mailbox for my site 
domain. So, every message sent to a mailbox that does not really exist 
will be dropped in that catch-all mailbox.

When I send messages to each user, I make the return path address be set 
to something like [EMAIL PROTECTED] .

For instance, messages sent to [EMAIL PROTECTED] by the PHP Classes 
site, will have the return path set to 
[EMAIL PROTECTED] .

Since these address really do not exist, they will be dropped in the 
catch-all mailbox for that domain. So, all I need to do is to run a 
script that polls the POP3 mailbox of my catch-all account and parse the 
To: address of the bounced messages to figure the subscriber address 
that is bouncing. Not all bounce message will have the To: address set 
correctly. The remaining message should be ignored.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Problem with PHP_AUTH_USER

2003-12-15 Thread Ng Hwee Hwee
hi,

i think $PHP_AUTH_USER will only get unset the next time session_start() is
called. try to use a header(location: ...) to direct your logout page to
your index page and then print $PHP_AUTH_USER right after session_start()..
by right, you should not have any value...

i faced the same problem and was puzzled for quite some time, but i think
this works..

hth
hwee

- Original Message -
From: Constantin Brinzoi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 5:16 PM
Subject: [PHP-DB] Problem with PHP_AUTH_USER


 Hi!

 Here is the problem:

 How can I unset the $PHP_AUTH_USER when the user clicks logout?

 The authentication works very well except the log out.
 I tried:
 session_destroy();
 unset($_SERVER['PHP_AUTH_USER'])

 and in the next line I did:

 print $PHP_AUTH_USER;

 and the value is still there.

 How can I unregister this variable so that the authentication window
 appears again.

 I'm using apache 2.0.40, php 4.2.2 compiled as a module, RedHat Linux
 9.0. Register globals is On.

 TIA
 Constantin Brinzoi.

 --
 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] problem: opening a new window, xxx.php

2003-12-15 Thread ckownghello
I try to use a button to open a small window, and the small window allows
user to insert , change data, which will change the data in the opener too.
As the small window requires some access to database(mysql), it takes time
and it seems the form in the small window is not created before any
assignment of the form's element:

Line 1: winPro = window.open(xxx.php,...);
Line 2: winPro.document.forms[0].h_code.value = sth;

It barks me that winPro.document.forms[0].h_code doesn't exist.. well, then
I alert and show the h_code's value, which is shown as undefined.
so i try to insert a while loop between Line 1 and 2:
while (winPro.document.forms[0] == null  winPro.document.forms[0].h_code
== null ){}

the code above works. It seems like the window is created but the form
isn't, and then the value is assigned.

any one has such experience? could anyone help to solve this problem?(it
looks too bad to do some no use loop..)

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



[PHP-DB] Max DB as Database for PHP

2003-12-15 Thread Morten Gulbrandsen
Hello,

Has anyone tried to connect to  MaxDB  with PHP ?

http://www.mysql.com/products/maxdb/index.html

According to what I  have read, but not actually tried.
PHP can connect to any database,
including Microsoft SQL Server  and PostgresSQL.

However MySQL is  not always the right choice.


Yours Sincerely

Morten Gulbrandsen

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