[PHP] RE: MSSQL 2000's 'real' type kills php

2002-05-14 Thread Mullin, Reginald

Jerome,

I'd had a similar problem a few weeks ago (see
http://marc.theaimsgroup.com/?l=php-generalm=101960285228542w=2).

Try modifying your SQL statement like so:
mssql_query(SET TEXTSIZE 2048 select inventory from products where code =
'FCA13');


O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Jerome Houston [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 8:52 PM
 To:   [EMAIL PROTECTED]
 Subject:  MSSQL 2000's 'real' type kills php
 
 Hi,
 
 i'm working on a win2k server running php 4.1.1  accessing MSSQL server
 2000 
 on a win2k server.
 
 i've got a problem with a table that has 'real' numbers in it.
 
 database snippet
 codeinventory name
 PRC01   2.33  Prince Brand Chips
 FCA13   9.934E-2  Frozen Calamari
 /database snippet
 
 when i
 mssql_query(select * from products);
 or, more specifically
 mssql_query(select inventory from products where code = 'FCA13');
 
 BOOM!  php crashes, and i get a pop-up window in MSIE that says, IE
 cannot 
 open the site ..  the connection with the server was reset
 
 but
 
 mssql_query(select * from products where code = 'PRC01');
 works like a charm.
 
 granted 9.934E-2 isn't an actual number for inventory, it should be
 0.10 
 .  BUT, i can't help that.  my application is not the only one that uses 
 this data.
 
 this happens with various numbers that have high precision.
 
 anyone run into this before?  any suggestions?
 
 thanks VERY much in advance,
 
 jerome
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.com
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] MSSQL paging with PHP

2002-04-29 Thread Mullin, Reginald

Guys,

Has anyone had much success in building a paging script with PHP for the
MSSQL database?
I've been working on such a script now for three (3) days, but to no avail.
Any help you can send my way would be greatly appreciated.
Thank you.

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




RE: [PHP] Out of memory error message

2002-04-23 Thread Mullin, Reginald

Guys,

I've finally been able to solve this problem.
See:
http://franklin.oit.unc.edu/cgi-bin/lyris.pl?visit=freetdsid=178084891.

The problem was being caused by http://www.freetds.org/faq.html#textdata.

I solved it by modifying my SQL statement like so:
$sql = SET TEXTSIZE 2048 SELECT
Item.ItemNumber,Item.Description,Item.Type,Item.Comments,Inventory.Site,Inve
ntory.Location,Inventory.ItemNumber,Inventory.SerialNumber,Inventory.Lot,Inv
entory.OnHandQuantity FROM Item,Inventory WHERE
(Item.ItemNumber='$ViewItemNumber' AND
Item.ItemNumber=Inventory.ItemNumber);

So far, it appears to be working!
No problems yet that I can see!
Just wanted to share!
 

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Mullin, Reginald 
 Sent: Monday, April 22, 2002 10:30 AM
 To:   'Chris Hewitt'
 Cc:   [EMAIL PROTECTED]
 Subject:  RE: [PHP] Out of memory error message
 
 Chris,
 
 Thanks for your feedback.
 
 Note: The ItemNumber is the Primary key for the Item table and the Foreign
 key for the Inventory table.  Also, I'm only selecting a limited number of
 fields in the MSSQL query string.
 
 P.S.: If it were a PHP/MSSQL error, shouldn't the browser spit out an
 error message as well? 
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
   -Original Message-
   From:   Chris Hewitt [SMTP:[EMAIL PROTECTED]]
   Sent:   Saturday, April 20, 2002 7:10 AM
   To: Mullin, Reginald
   Subject:Re: [PHP] Out of memory error message
 
   Reginald,
 
   I assume both the Item and Inventory tables have an index on
 ItemNumber? 
   If not then a full table scan would want lots of memory and time if
 the 
   tables contain a large number of rows.
 
   Just a thought.
   HTH
 
   Chris
 
   Mullin, Reginald wrote:
 
   Hi Guys,
   
   Does anyone know what the following error message is and how I can
 go about
   solving it?
   
   ***ERROR MSG***
   Out of memory during large request for 2147487744 bytes, total
 sbrk() is
   1459608 bytes.
   
   This error message gets written to Apache's error logs every other
 time I
   execute my MSSQL query.  The web browser then displays The page
 cannot be
   displayed error (404).
   
   ***SAMPLE MSSQL QUERY***
   if ($ViewItemNumber){
   $ViewItemNumber = urldecode($ViewItemNumber);
   $sql = SELECT
   
 Item.ItemNumber,Item.Description,Item.Type,Item.Comments,Inventory.Site,I
 nve
   
 ntory.Location,Inventory.ItemNumber,Inventory.SerialNumber,Inventory.Lot,
 Inv
   entory.OnHandQuantity FROM Item,Inventory WHERE
   (Item.ItemNumber='$ViewItemNumber' AND
   Item.ItemNumber=Inventory.ItemNumber);
   $query = mssql_query($sql) or die (THE SECOND (2) TABLE SELECTION
   FAILED.);
   $results = mssql_fetch_array($query);
   echo $results['ItemNumber'];
   }
   
   
   Note: I'm running LAMP locally (NY) and connecting remotely to a
 Windows
   2000 box running MS SQL Server 2000 (UK) with the FreeTDS package. 
   
   
   O  From Now 'Till Then,
   \-Reginald Alex Mullin
   /\  212-894-1690
   
   
   
   
 **
   This email and any files transmitted with it are confidential and
   intended solely for the use of the individual or entity to whom
 they
   are addressed. If you have received this email in error please
 notify
   the postmaster at [EMAIL PROTECTED]
   
   
   www.sothebys.com
   
 **
   
   
 
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




RE: [PHP] Out of memory error message

2002-04-22 Thread Mullin, Reginald

Chris,

Thanks for your feedback.

Note: The ItemNumber is the Primary key for the Item table and the Foreign
key for the Inventory table.  Also, I'm only selecting a limited number of
fields in the MSSQL query string.

P.S.: If it were a PHP/MSSQL error, shouldn't the browser spit out an error
message as well? 

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Chris Hewitt [SMTP:[EMAIL PROTECTED]]
 Sent: Saturday, April 20, 2002 7:10 AM
 To:   Mullin, Reginald
 Subject:  Re: [PHP] Out of memory error message
 
 Reginald,
 
 I assume both the Item and Inventory tables have an index on ItemNumber? 
 If not then a full table scan would want lots of memory and time if the 
 tables contain a large number of rows.
 
 Just a thought.
 HTH
 
 Chris
 
 Mullin, Reginald wrote:
 
 Hi Guys,
 
 Does anyone know what the following error message is and how I can go
 about
 solving it?
 
 ***ERROR MSG***
 Out of memory during large request for 2147487744 bytes, total sbrk()
 is
 1459608 bytes.
 
 This error message gets written to Apache's error logs every other time I
 execute my MSSQL query.  The web browser then displays The page cannot
 be
 displayed error (404).
 
 ***SAMPLE MSSQL QUERY***
 if ($ViewItemNumber){
 $ViewItemNumber = urldecode($ViewItemNumber);
 $sql = SELECT
 Item.ItemNumber,Item.Description,Item.Type,Item.Comments,Inventory.Site,I
 nve
 ntory.Location,Inventory.ItemNumber,Inventory.SerialNumber,Inventory.Lot,
 Inv
 entory.OnHandQuantity FROM Item,Inventory WHERE
 (Item.ItemNumber='$ViewItemNumber' AND
 Item.ItemNumber=Inventory.ItemNumber);
 $query = mssql_query($sql) or die (THE SECOND (2) TABLE SELECTION
 FAILED.);
 $results = mssql_fetch_array($query);
 echo $results['ItemNumber'];
 }
 
 
 Note: I'm running LAMP locally (NY) and connecting remotely to a Windows
 2000 box running MS SQL Server 2000 (UK) with the FreeTDS package. 
 
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the postmaster at [EMAIL PROTECTED]
 
 
 www.sothebys.com
 **
 
 
 
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] Out of memory error message

2002-04-19 Thread Mullin, Reginald

Hi Guys,

Does anyone know what the following error message is and how I can go about
solving it?

***ERROR MSG***
Out of memory during large request for 2147487744 bytes, total sbrk() is
1459608 bytes.

This error message gets written to Apache's error logs every other time I
execute my MSSQL query.  The web browser then displays The page cannot be
displayed error (404).

***SAMPLE MSSQL QUERY***
if ($ViewItemNumber){
$ViewItemNumber = urldecode($ViewItemNumber);
$sql = SELECT
Item.ItemNumber,Item.Description,Item.Type,Item.Comments,Inventory.Site,Inve
ntory.Location,Inventory.ItemNumber,Inventory.SerialNumber,Inventory.Lot,Inv
entory.OnHandQuantity FROM Item,Inventory WHERE
(Item.ItemNumber='$ViewItemNumber' AND
Item.ItemNumber=Inventory.ItemNumber);
$query = mssql_query($sql) or die (THE SECOND (2) TABLE SELECTION
FAILED.);
$results = mssql_fetch_array($query);
echo $results['ItemNumber'];
}


Note: I'm running LAMP locally (NY) and connecting remotely to a Windows
2000 box running MS SQL Server 2000 (UK) with the FreeTDS package. 


O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

Hi Guys,

I've been experiencing some problems when trying to build 3 arrays with the
ID values of all of the groups a user belongs to.  (I then want to register
these arrays into the current session).  The arrays only appear to be
getting the first value (group ID) instead of all of the values the user
belongs to.  What am I doing wrong here?

My code looks like this:

File: login.php
# if $employee_1, query db workgroups table to check if $emp_login_id
belongs to any groups
$sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
$result_2 = @mysql_query($sql_2) or die (mysql_error());
$rows = mysql_num_rows($result_2);
$employee_2 = mysql_fetch_array($result_2);
# if match, set workgroups login variables in array, then register
workgroups login variables in session
if ($employee_2){
$emp_login_wkgrp_id = array ();
$emp_login_grp_id = array ();
$emp_login_role_id = array ();
for ($i=0; $i$rows; $i++){
$emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
$emp_login_grp_id[$i] = $employee_2[grp_id];
$emp_login_role_id[$i] = $employee_2[role_id];
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');
}

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




RE: [PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

Mark,

I'm still experiencing the same problem.  Only one record is being added to
the arrays.  There are currently two records in the DB workgroups table
matching the WHERE emp_id='$emp_login_id criteria. 

Here's the 2 records in the DB workgroups table:
FIELDS  Value#1 Value#2
wkgrp_id1   4
grp_id  111 222
emp_id  39  39
wkgrp_create_date   2002-03-16 23:45:43 -00-00 00:00:00
wkgrp_change_date   2002-03-16 23:45:43 -00-00 00:00:00
wkgrp_change_by webmaster   webmaster
wkgrp_create_by webmaster   webmaster
role_id 1   1

I'm only getting back Value#2.

Here's the modified PHP code:
File: login.php
if ($employee_2){
$emp_login_wkgrp_id = array();
$emp_login_grp_id = array();
$emp_login_role_id = array();
$i = 0;
while($employee_2 = mysql_fetch_array($result_2)){
$emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
$emp_login_grp_id[$i] = $employee_2[grp_id];
$emp_login_role_id[$i] = $employee_2[role_id];
$i++;
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');
}

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Mark Heintz PHP Mailing Lists [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, March 18, 2002 1:26 PM
 To:   Mullin, Reginald
 Cc:   [EMAIL PROTECTED]
 Subject:  Re: [PHP] Creating arrays using results from MySQL query
 
 
 You have to call mysql_fetch_array for each record in your result set...
 
 $emp_login_wkgrp_id = array ();
 $emp_login_grp_id = array ();
 $emp_login_role_id = array ();
 $i = 0;
 while($employee_2 = mysql_fetch_array($result_2)){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   $i++;
 }
 
 mysql_fetch_array will return false when you run out of results, breaking
 the while loop.
 
 Check the manual for more info:
 http://www.php.net/manual/en/function.mysql-fetch-array.php
 
 
 mh.
 
 
 On Mon, 18 Mar 2002, Mullin, Reginald wrote:
 
  Hi Guys,
 
  I've been experiencing some problems when trying to build 3 arrays with
 the
  ID values of all of the groups a user belongs to.  (I then want to
 register
  these arrays into the current session).  The arrays only appear to be
  getting the first value (group ID) instead of all of the values the user
  belongs to.  What am I doing wrong here?
 
  My code looks like this:
 
  File: login.php
  # if $employee_1, query db workgroups table to check if $emp_login_id
  belongs to any groups
  $sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
  $result_2 = @mysql_query($sql_2) or die (mysql_error());
  $rows = mysql_num_rows($result_2);
  $employee_2 = mysql_fetch_array($result_2);
  # if match, set workgroups login variables in array, then register
  workgroups login variables in session
  if ($employee_2){
  $emp_login_wkgrp_id = array ();
  $emp_login_grp_id = array ();
  $emp_login_role_id = array ();
  for ($i=0; $i$rows; $i++){
  $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
  $emp_login_grp_id[$i] = $employee_2[grp_id];
  $emp_login_role_id[$i] = $employee_2[role_id];
  }
  session_register('emp_login_wkgrp_id');
  session_register('emp_login_grp_id');
  session_register('emp_login_role_id');
  }
 
  O  From Now 'Till Then,
  \-Reginald Alex Mullin
  /\  212-894-1690
 
 
 
  **
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom they
  are addressed. If you have received this email in error please notify
  the postmaster at [EMAIL PROTECTED]
 
 
  www.sothebys.com
  **

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




FW: [PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

I've just added another record to the table.  Now they're a total of 3
records matching the WHERE emp_id='$emp_login_id criteria.  When I
print_r(array_values($emp_login_grp_id)); I get the following values:
Array ( [0] = 222 [1] = 333 ).  For some reason, it seems to be skipping
the first record.

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Mullin, Reginald 
 Sent: Monday, March 18, 2002 2:29 PM
 To:   'Mark Heintz PHP Mailing Lists'; [EMAIL PROTECTED]
 Subject:  RE: [PHP] Creating arrays using results from MySQL query
 
 Mark,
 
 I'm still experiencing the same problem.  Only one record is being added
 to the arrays.  There are currently two records in the DB workgroups table
 matching the WHERE emp_id='$emp_login_id criteria. 
 
 Here's the 2 records in the DB workgroups table:
 FIELDSValue#1 Value#2
 wkgrp_id  1   4
 grp_id111 222
 emp_id39  39
 wkgrp_create_date 2002-03-16 23:45:43 -00-00 00:00:00
 wkgrp_change_date 2002-03-16 23:45:43 -00-00 00:00:00
 wkgrp_change_by   webmaster   webmaster
 wkgrp_create_by   webmaster   webmaster
 role_id   1   1
 
 I'm only getting back Value#2.
 
 Here's the modified PHP code:
 File: login.php
 if ($employee_2){
   $emp_login_wkgrp_id = array();
   $emp_login_grp_id = array();
   $emp_login_role_id = array();
   $i = 0;
   while($employee_2 = mysql_fetch_array($result_2)){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   $i++;
   }
   session_register('emp_login_wkgrp_id');
   session_register('emp_login_grp_id');
   session_register('emp_login_role_id');
 }
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
 -Original Message-
 From: Mark Heintz PHP Mailing Lists [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, March 18, 2002 1:26 PM
 To:   Mullin, Reginald
 Cc:   [EMAIL PROTECTED]
 Subject:  Re: [PHP] Creating arrays using results from MySQL query
 
 
 You have to call mysql_fetch_array for each record in your result set...
 
 $emp_login_wkgrp_id = array ();
 $emp_login_grp_id = array ();
 $emp_login_role_id = array ();
 $i = 0;
 while($employee_2 = mysql_fetch_array($result_2)){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   $i++;
 }
 
 mysql_fetch_array will return false when you run out of results, breaking
 the while loop.
 
 Check the manual for more info:
 http://www.php.net/manual/en/function.mysql-fetch-array.php
 
 
 mh.
 
 
 On Mon, 18 Mar 2002, Mullin, Reginald wrote:
 
  Hi Guys,
 
  I've been experiencing some problems when trying to build 3 arrays with
 the
  ID values of all of the groups a user belongs to.  (I then want to
 register
  these arrays into the current session).  The arrays only appear to be
  getting the first value (group ID) instead of all of the values the user
  belongs to.  What am I doing wrong here?
 
  My code looks like this:
 
  File: login.php
  # if $employee_1, query db workgroups table to check if $emp_login_id
  belongs to any groups
  $sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
  $result_2 = @mysql_query($sql_2) or die (mysql_error());
  $rows = mysql_num_rows($result_2);
  $employee_2 = mysql_fetch_array($result_2);
  # if match, set workgroups login variables in array, then register
  workgroups login variables in session
  if ($employee_2){
  $emp_login_wkgrp_id = array ();
  $emp_login_grp_id = array ();
  $emp_login_role_id = array ();
  for ($i=0; $i$rows; $i++){
  $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
  $emp_login_grp_id[$i] = $employee_2[grp_id];
  $emp_login_role_id[$i] = $employee_2[role_id];
  }
  session_register('emp_login_wkgrp_id');
  session_register('emp_login_grp_id');
  session_register('emp_login_role_id');
  }
 
  O  From Now 'Till Then,
  \-Reginald Alex Mullin
  /\  212-894-1690
 
 
 
  **
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom they
  are addressed. If you have received this email in error please notify
  the postmaster at [EMAIL PROTECTED]
 
 
  www.sothebys.com
  **

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




RE: [PHP] Creating arrays using results from MySQL query

2002-03-18 Thread Mullin, Reginald

Hi Guys,

I've finally been able to figure this out.  Turns out, I had to make
another, different SQL query to the DB instead of re-using the prior SQL
query statement.

The *new* code looks like this:
File: login.php
# if $employee_1, query db workgroups table to check if $emp_login_id
belongs to any groups
$sql_2 = SELECT * FROM workgroups WHERE emp_id='$emp_login_id';
$result_2 = @mysql_query($sql_2) or die (mysql_error());
$employee_2 = mysql_fetch_array($result_2);
# if match, set workgroups login variables in array, then register
workgroups login variables in session
if ($employee_2){
$emp_login_wkgrp_id = array();
$emp_login_grp_id = array();
$emp_login_role_id = array();
$i=0;
$result_3 = @mysql_query($sql_2) or die (mysql_error());
while($employee_3 = mysql_fetch_array($result_3)){
$emp_login_wkgrp_id[$i] = $employee_3[wkgrp_id];
$emp_login_grp_id[$i] = $employee_3[grp_id];
$emp_login_role_id[$i] = $employee_3[role_id];
$i++;
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');
}


Now when I print_r(array_values($emp_login_grp_id)); I get the following
values: Array ( [0] = 111 [1] = 222 [2] = 333 ).

Many thanks to everyone (Mark) for all of your help.

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: Mullin, Reginald 
 Sent: Monday, March 18, 2002 2:45 PM
 To:   '[EMAIL PROTECTED]'
 Subject:  FW: [PHP] Creating arrays using results from MySQL query
 
 I've just added another record to the table.  Now they're a total of 3
 records matching the WHERE emp_id='$emp_login_id criteria.  When I
 print_r(array_values($emp_login_grp_id)); I get the following values:
 Array ( [0] = 222 [1] = 333 ).  For some reason, it seems to be skipping
 the first record.
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
 -Original Message-
 From: Mullin, Reginald 
 Sent: Monday, March 18, 2002 2:29 PM
 To:   'Mark Heintz PHP Mailing Lists'; [EMAIL PROTECTED]
 Subject:  RE: [PHP] Creating arrays using results from MySQL query
 
 Mark,
 
 I'm still experiencing the same problem.  Only one record is being added
 to the arrays.  There are currently two records in the DB workgroups table
 matching the WHERE emp_id='$emp_login_id criteria. 
 
 Here's the 2 records in the DB workgroups table:
 FIELDSValue#1 Value#2
 wkgrp_id  1   4
 grp_id111 222
 emp_id39  39
 wkgrp_create_date 2002-03-16 23:45:43 -00-00 00:00:00
 wkgrp_change_date 2002-03-16 23:45:43 -00-00 00:00:00
 wkgrp_change_by   webmaster   webmaster
 wkgrp_create_by   webmaster   webmaster
 role_id   1   1
 
 I'm only getting back Value#2.
 
 Here's the modified PHP code:
 File: login.php
 if ($employee_2){
   $emp_login_wkgrp_id = array();
   $emp_login_grp_id = array();
   $emp_login_role_id = array();
   $i = 0;
   while($employee_2 = mysql_fetch_array($result_2)){
   $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
   $emp_login_grp_id[$i] = $employee_2[grp_id];
   $emp_login_role_id[$i] = $employee_2[role_id];
   $i++;
   }
   session_register('emp_login_wkgrp_id');
   session_register('emp_login_grp_id');
   session_register('emp_login_role_id');
 }
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
   -Original Message-
   From:   Mark Heintz PHP Mailing Lists
 [SMTP:[EMAIL PROTECTED]]
   Sent:   Monday, March 18, 2002 1:26 PM
   To: Mullin, Reginald
   Cc: [EMAIL PROTECTED]
   Subject:Re: [PHP] Creating arrays using results from MySQL
 query
 
 
   You have to call mysql_fetch_array for each record in your result
 set...
 
   $emp_login_wkgrp_id = array ();
   $emp_login_grp_id = array ();
   $emp_login_role_id = array ();
   $i = 0;
   while($employee_2 = mysql_fetch_array($result_2)){
 $emp_login_wkgrp_id[$i] = $employee_2[wkgrp_id];
 $emp_login_grp_id[$i] = $employee_2[grp_id];
 $emp_login_role_id[$i] = $employee_2[role_id];
 $i++;
   }
 
   mysql_fetch_array will return false when you run out of results,
 breaking
   the while loop.
 
   Check the manual for more info:
   http://www.php.net/manual/en/function.mysql-fetch-array.php
 
 
   mh.
 
 
   On Mon, 18 Mar 2002, Mullin, Reginald wrote:
 
Hi Guys,
   
I've been experiencing some problems when trying to build 3 arrays
 with the
ID values of all of the groups a user belongs to.  (I then want to
 register

RE: [PHP] Re: Is there a GoTo Page Function?

2002-03-06 Thread Mullin, Reginald

You can also use JavaScript to redirect the user to another page.

After your form has finished updating your database, do the following:

?php
echo script
language=\javascript\window.location.href='NEXT_PAGE.html';/script;
?

Note:  Your client's browser must support JavaScript for this to work.
As suggested by Hugh, it's much better to use the php header(); tag.
But, this will only work if you haven't already passed a header to your
page.

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690

 -Original Message-
 From: hugh danaher [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, March 05, 2002 4:51 PM
 To:   php
 Subject:  Re: [PHP] Re: Is there a GoTo Page Function?
 
 Andre,
 Have your form action point to a page that has your database storage code,
 and nothing else (no screen output at all!).  Have this page start with
 the
 ?php tag with nothing above the tag (no html and no blank lines either!).
 Once your storage is complete, then use the header(location:
 somepageyouname) to go to the page you have next in line.  Oh, and make
 sure to use the ? to end your php code.
 
 Once you get the above to work, then you can add decision statements which
 will help qualify your data.  (e.g. if (!isset($name)) die (You need to
 fill in your name.  Use the browser's back button and input this
 information.);).
 
 Hope this helps,
 Hugh
 - Original Message -
 From: Michael Kimsal [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, March 05, 2002 1:15 PM
 Subject: [PHP] Re: Is there a GoTo Page Function?
 
 
  Andre Dubuc wrote:
 
   As a complete newbie to PHP, and relative novice to html, this one has
 me
   stumped. Rather than wade through volumes of documentation, I thought
 I'd
   risk asking it here.
  
   After inserting variables from a fill-out html form into my database,
 I
 would
   like the form to goto the next html page, but I cannot figure out
 how
 to do
   this basic function. I assume that when one clicks a Submit button,
 the
   info is sent to the server, but how do you call a new page? [In my old
   Paradox PAL days, this was accomplished very easily. I cannot find a
   corresponding function either in PHP or html.]
  
   (I.e: Once a person clicks on Input type=submit value=Accept Is
 there a
   function that can redirect the form to a new form?)
  
   Any help here would be greatly appreciated (or pointers to a good
 working
   tutorial that covers this area!)
  
 
 
  Usually people will do one of two things:
 
  Make the action of the form tag point to the new page directly.  That
  page would take care of any form data processing that needed to happen.
 
  OR
 
  Have the form call itself, then when it's done, use a HEADER tag with
  location: to redirect
  header(Location: newpage.php);
 
  Hope that helps.
 
 
  Michael Kimsal
  http://www.phphelpdesk.com
  734-480-9961
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] Displaying image from MySql DB

2002-02-22 Thread Mullin, Reginald

Hi Guys,

I have some images stored in my MySql database that I'd like to display on
the bottom of my HTML page.  However, whenever I attempt to display the
images using the follow code:

$getPhoto = mysql_fetch_object($result);
$Type = $getPhoto-type;
Header(Content-type: $Type);
$Body = $getPhoto-body;
echo $Body;
flush();

I get an error that states: Cannot add header information - headers already
sent by
Now I understand why I'm getting the error.  What I'd like to know is how to
get around it?  Basically what I want is the image in the DB to be displayed
like any regular image would be on an HTML page, i.e. img
src=imageGoesHere height=x  width=x border=x.  However, I still
need to pass the HTML headers.

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  212-894-1690



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




[PHP] Using PHP to post the contents of an email to MySql database

2002-01-11 Thread Mullin, Reginald

Hi Guys,
I recently read an email entitled Can a PHP program receive an e-mail and
write it to a file??? in the PHP archives (see
http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and wanted
to ask a follow up question.  I'm a novice programmer, new to PHP, and
unfamiliar with the ways in which to access the Standard Input for a PHP
program.  Can anyone provide me with some examples or online reference
material as to how I can go about doing this.  For example, is there a
particular variable or function that I should call?  Or, is there something
that needs to be initialized?
P.S.  Thanks, in advance, for all of your help and assistance. 

O  From Now 'Till Then,
\-Reginald Alex Mullin
/\  More Questions than Answers



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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




FW: [PHP] Using PHP to post the contents of an email to MySql database

2002-01-11 Thread Mullin, Reginald

 Hi Guys,
 
 I've written the following program to write an email from PHP Standard
 Input to an html file:
 
 **
 ***
 ?php
 $file = php://stdin;
 $fp = @fopen($file,rb);
 if ($fp){
   $contents = fread($fp,filesize($file));
   $fw = @fopen (/www/htdocs/pgs/htm/stdin.htm, wb+);
   if ($fw){
   flock($fw, 1);
   fwrite($fw, $contents, filesize($file));
   fclose($fw);
   } else {
   print The file stdin.htm does not exist!;
   } 
   @fclose($fp);
 } else {
   print The file php://stdin does not exist!;
 }
 ?
 **
 ***
 
 However, whenever the email attempts to access the program, the
 mailer-daemon returns the following error message:
 
 **
 ***
 The original message was received at Fri, 11 Jan 2002 15:01:34 -0500
 from [63.105.171.52]
 
- The following addresses had permanent fatal errors -
 |php -q /www/htdocs/exe/php/Email2MySql.php
 (expanded from: [EMAIL PROTECTED])
 
- Transcript of session follows -
 sh: php: command not found
 554 |php -q /www/htdocs/exe/php/Email2MySql.php... unknown mailer error
 127
 **
 ***
 
 What am I doing wrong here?  Did I screw up the alias?  Does my system not
 support this functionality?  HELP.
 
 P.S.  My virtual server is running Linux.
 
 
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  212-894-1690
 
 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, January 11, 2002 12:30 PM
 To:   [EMAIL PROTECTED]; Mullin, Reginald
 Subject:  Re: [PHP] Using PHP to post the contents of an email to
 MySql database
 
 
 
 on linux, you could simply open these 'files':
 
 /dev/stdin
 /dev/stdout
 
 for windows, and for portability, PHP provides the following dummy's,
 which can also simply be used by fopen() :
 
 php://stdin
 php://stdout
 
 
 bvr.
 
 
 
 On Fri, 11 Jan 2002 12:19:05 -0500, Mullin, Reginald wrote:
 
 Hi Guys,
 I recently read an email entitled Can a PHP program receive an e-mail
 and
 write it to a file??? in the PHP archives (see
 http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and
 wanted
 to ask a follow up question.  I'm a novice programmer, new to PHP, and
 unfamiliar with the ways in which to access the Standard Input for a PHP
 program.  Can anyone provide me with some examples or online reference
 material as to how I can go about doing this.  For example, is there a
 particular variable or function that I should call?  Or, is there
 something
 that needs to be initialized?
 P.S.  Thanks, in advance, for all of your help and assistance. 
 
 O  From Now 'Till Then,
 \-Reginald Alex Mullin
 /\  More Questions than Answers
 
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the postmaster at [EMAIL PROTECTED]
 
 
 www.sothebys.com
 **
 
 
 -- 
 PHP General 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]
 
 
 
 


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]


www.sothebys.com
**


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