[PHP-DB] PHP - Ms SQL Database connection.

2003-01-15 Thread Rene Groothuis (Aeqis)
Hi All, 

Has somebody made a connection from PHP (4.2.2) running on Linux os to a
Ms SQL database running on a W2K machine. If so how have you done that?
Where can I find some kind of tutorial or howto?

Cheers, Rene.

===
R. Groothuis - Aeqis
Gruttosingel 50
2496 HX Den Haag - The Netherlands
E-mail: [EMAIL PROTECTED]
Tel: +31-15-3618824
Mobile: +31-6-51807877
Fax: +31-15-3618823



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




[PHP-DB] Re: PHP - Ms SQL Database connection.

2003-01-15 Thread J.Veenhuijsen
I guess it is just like connecting to the database
at your local machine .
Check security on wk2 so you are allowed to connect.

Jochem

Rene Groothuis wrote:

Hi All, 

Has somebody made a connection from PHP (4.2.2) running on Linux os to a
Ms SQL database running on a W2K machine. If so how have you done that?
Where can I find some kind of tutorial or howto?

Cheers, Rene.

===
R. Groothuis - Aeqis
Gruttosingel 50
2496 HX Den Haag - The Netherlands
E-mail: [EMAIL PROTECTED]
Tel: +31-15-3618824
Mobile: +31-6-51807877
Fax: +31-15-3618823




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




RE: [PHP-DB] Unlimited Categories

2003-01-15 Thread Daevid Vincent
Well, I'm not sure if you actually truly mean unlimited, because if
you do, be aware that when you define those fields:

# BIGINTUNSIGNED = 8 Byte =  =
18446744073709551615
# INT   UNSIGNED = 4 Byte =  = 4294967295
# MEDIUMINT UNSIGNED = 3 Byte = FF   = 16777215
# SMALLINT  UNSIGNED = 2 Byte =  = 65535
# TINYINT   UNSIGNED = 1 Byte = FF   = 255

# BIGINTSIGNED = -9223372036854775808 to 9223372036854775807  
# INT   SIGNED = -2147483648 to 2147483647 
# MEDIUMINT SIGNED = -8388608  to 8388607  
# SMALLINT  SIGNED = -32768  to 32767 
# TINYINT   SIGNED = -128  to 127

So, while an UNSIGNED BIGINT would be a bahugabyte number, it is in fact
finite and not unlimited. :)

 -Original Message-
 From: Micah Stevens [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, January 13, 2003 9:45 PM
 To: Gerard Samuel
 Cc: php-db
 Subject: Re: [PHP-DB] Unlimited Categories
 
 
 Use the parent/child relationship thing:
 
 CREATE TABLE Categories (
   CategoryID int(11) NOT NULL auto_increment,
   ParentID int(11) NOT NULL default '0',
   Category_Name tinytext NOT NULL,
   PRIMARY KEY  (CategoryID)
 ) TYPE=MyISAM;
 
 So at each level you can find the subcategories by:
 
 SELECT * FROM Category WHERE ParentID = $This_Level_ID;
 
 The top level would have a ParentID of 0.
 
 *shrug* - One way to do it. 
 
 -Micah
 
 On Mon, 2003-01-13 at 21:32, Gerard Samuel wrote:
 
  Im figuring this is more of an sql question than anything else.
  I'm trying to figure out a table structure to create 
 unlimited depths of 
  categorical data.
  I've done something for category/subcategories before, but 
 haven't an 
  idea how to create categories at an unlimited depth.
  
  Any pointers would be greatly appreciated.
  Thanks
  
  -- 
  Gerard Samuel
  http://www.trini0.org:81/
  http://dev.trini0.org:81/
 
 -- 
 Raincross Technologies
 Development and Consulting Services
 http://www.raincross-tech.com
 
 


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




SV: [PHP-DB] LEFT JOIN not working

2003-01-15 Thread Henrik Hornemann
Hi,

You might want to try something like:

SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM( 
IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate LEFT 
JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name 
HAVING YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) =
'01' 
AND DAYOFMONTH(ads_displayrate.date) = '05' 
GROUP BY ads_displayrate.name 
ORDER BY ads_displayrate.name

regards Henrik Hornemann

-Oprindelig meddelelse-
Fra: Lisi [mailto:[EMAIL PROTECTED]]
Sendt: 14. januar 2003 18:47
Til: Ignatius Reilly
Cc: PHP-DB
Emne: Re: [PHP-DB] LEFT JOIN not working


Still not working. I made the change, and I'm still getting all results. I 
even tried it without the leading '0' in front of the 1, no good.

Here's my current query, with suggested changes:

SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM( 
IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate LEFT 
JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name AND 
YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) = '01' 
AND DAYOFMONTH(ads_displayrate.date) = '05' GROUP BY ads_displayrate.name 
ORDER BY ads_displayrate.name

ads_displayrate.date is a column of date type, so as far as I understand 
this should work.

Is there some typo I'm missing?

At 07:15 PM 1/9/03 +0100, you wrote:
Oops! I missed again.

If you specify conditions pertaining to the right-hand table, such as:
ads_clickrate.date = '2001',

Then you will lose all result rows for which the right-hand data is NULL.
Not the expected result.

So your restricting WHERE clauses must apply to the left-hand table only.

Therefore:
WHERE YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) =
'01'
(if your table ads_displayrate has such date fields).

HTH
Ignatius

- Original Message -
From: Lisi [EMAIL PROTECTED]
To: Ignatius Reilly [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 6:54 PM
Subject: Re: [PHP-DB] LEFT JOIN not working


  Cool! It's mostly working now, the only problem is it's ignoring the
other
  clauses in the ON clause that select the desired date. Perhaps it's not
  supposed to be connected this way? How would I select specific dates?
 
  Thanks again,
 
  -Lisi
 
  At 01:20 PM 1/9/03 +0100, you wrote:
  Oops! Sorry, I missed it the first time.
  
  Your query should start as:
  SELECT ads_displayrate.name
  instead of
  SELECT ads_clickrate.name
  
  then you will always have a non-NULL name (coming from the table on the
left
  of the LEFT JOIN).
  
  HTH
  Ignatius, from Brussels
  
  Where the fuck is Belgium?
  D. Ivester, CEO, Coca Cola
  
  
  - Original Message -
  From: Lisi [EMAIL PROTECTED]
  To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB
  [EMAIL PROTECTED]
  Sent: Thursday, January 09, 2003 1:11 PM
  Subject: Re: [PHP-DB] LEFT JOIN not working
  
  
Exactly my question - why does it not have a name? How would I
modify
my
query to get a row with a name but null value for date? I thought
the
join
would take care of this, but I'm obviously not doing it right.
   
You mention a unique identifier, there is a separate table with a
row
for
each ad, containing name, URL, and a unique ID number
(autoincrement).
Should this table be included somehow in the query? How would this
help?
   
Thanks,
   
-Lisi
   
At 12:45 PM 1/9/03 +0100, Ignatius Reilly wrote:
Your 4th row ought to have an identifier of some sort. From your
SELECT
statement, this seems to be the name. Why does it not have a name?
  Probably
what you want is a row with a name but a NULL value for
  ads_clickrate.date.

(by the way it is EXTREMELY advisable to use an abstract
identifier,
such
  as
an id, unique and required, instead of name)

Ignatius

- Original Message -
From: Lisi [EMAIL PROTECTED]
To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB
[EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 12:18 PM
Subject: Re: [PHP-DB] LEFT JOIN not working


  OK, this helped a bit.  Now I have, in addition to the three
rows
of
  ads
  that have ben clicked on, a fourth row with no ad name, 0
  clickthroughs,
  and 24 displays. That plus the other three account for all the
  displayed
ads.
 
  However, since it is returning a null value for any ad name that
has
  not
  been clicked on, and then it's grouped by ad name, it lumps all
non-clicked
  ads into one row. What I need is to see each ad on a separate
row,
  which
is
  what I thought a LEFT JOIN was supposed to do.
 
  Any suggestions?
 
  Thanks,
 
  -Lisi
 
 
  At 11:07 AM 1/9/03 +0100, Ignatius Reilly wrote:
  problem 1:
  move the WHERE clauses to the ON 

Re: [PHP-DB] LEFT JOIN not working

2003-01-15 Thread Ignatius Reilly
Should work (provided that the HAVING clauses be written after the GROUP BY)

But less efficient. The point of using the WHERE clauses is to restrict
during the JOIN. What you propose amounts to joining the full left table,
which may be very expensive, especially in the case of web log data.

Ignatius

- Original Message -
From: Henrik Hornemann [EMAIL PROTECTED]
To: Ignatius Reilly [EMAIL PROTECTED]
Cc: PHP-DB [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 10:56 AM
Subject: SV: [PHP-DB] LEFT JOIN not working


 Hi,

 You might want to try something like:

 SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM(
 IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate
LEFT
 JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name
 HAVING YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date)
=
 '01'
 AND DAYOFMONTH(ads_displayrate.date) = '05'
 GROUP BY ads_displayrate.name
 ORDER BY ads_displayrate.name

 regards Henrik Hornemann

 -Oprindelig meddelelse-
 Fra: Lisi [mailto:[EMAIL PROTECTED]]
 Sendt: 14. januar 2003 18:47
 Til: Ignatius Reilly
 Cc: PHP-DB
 Emne: Re: [PHP-DB] LEFT JOIN not working


 Still not working. I made the change, and I'm still getting all results. I
 even tried it without the leading '0' in front of the 1, no good.

 Here's my current query, with suggested changes:

 SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM(
 IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate
LEFT
 JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name AND
 YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) = '01'
 AND DAYOFMONTH(ads_displayrate.date) = '05' GROUP BY ads_displayrate.name
 ORDER BY ads_displayrate.name

 ads_displayrate.date is a column of date type, so as far as I understand
 this should work.

 Is there some typo I'm missing?

 At 07:15 PM 1/9/03 +0100, you wrote:
 Oops! I missed again.
 
 If you specify conditions pertaining to the right-hand table, such as:
 ads_clickrate.date = '2001',
 
 Then you will lose all result rows for which the right-hand data is NULL.
 Not the expected result.
 
 So your restricting WHERE clauses must apply to the left-hand table only.
 
 Therefore:
 WHERE YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date)
=
 '01'
 (if your table ads_displayrate has such date fields).
 
 HTH
 Ignatius
 
 - Original Message -
 From: Lisi [EMAIL PROTECTED]
 To: Ignatius Reilly [EMAIL PROTECTED]
 Sent: Thursday, January 09, 2003 6:54 PM
 Subject: Re: [PHP-DB] LEFT JOIN not working
 
 
   Cool! It's mostly working now, the only problem is it's ignoring the
 other
   clauses in the ON clause that select the desired date. Perhaps it's
not
   supposed to be connected this way? How would I select specific dates?
  
   Thanks again,
  
   -Lisi
  
   At 01:20 PM 1/9/03 +0100, you wrote:
   Oops! Sorry, I missed it the first time.
   
   Your query should start as:
   SELECT ads_displayrate.name
   instead of
   SELECT ads_clickrate.name
   
   then you will always have a non-NULL name (coming from the table on
the
 left
   of the LEFT JOIN).
   
   HTH
   Ignatius, from Brussels
   
   Where the fuck is Belgium?
   D. Ivester, CEO, Coca Cola
   
   
   - Original Message -
   From: Lisi [EMAIL PROTECTED]
   To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB
   [EMAIL PROTECTED]
   Sent: Thursday, January 09, 2003 1:11 PM
   Subject: Re: [PHP-DB] LEFT JOIN not working
   
   
 Exactly my question - why does it not have a name? How would I
 modify
 my
 query to get a row with a name but null value for date? I thought
 the
 join
 would take care of this, but I'm obviously not doing it right.

 You mention a unique identifier, there is a separate table with a
 row
 for
 each ad, containing name, URL, and a unique ID number
 (autoincrement).
 Should this table be included somehow in the query? How would this
 help?

 Thanks,

 -Lisi

 At 12:45 PM 1/9/03 +0100, Ignatius Reilly wrote:
 Your 4th row ought to have an identifier of some sort. From your
 SELECT
 statement, this seems to be the name. Why does it not have a
name?
   Probably
 what you want is a row with a name but a NULL value for
   ads_clickrate.date.
 
 (by the way it is EXTREMELY advisable to use an abstract
 identifier,
 such
   as
 an id, unique and required, instead of name)
 
 Ignatius
 
 - Original Message -
 From: Lisi [EMAIL PROTECTED]
 To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB
 [EMAIL PROTECTED]
 Sent: Thursday, January 09, 2003 12:18 PM
 Subject: Re: [PHP-DB] LEFT JOIN not working
 
 
   OK, this helped a bit.  Now I have, in addition to the 

[PHP-DB] making my own week? :)

2003-01-15 Thread Matthew Nock
Hi All,

I am currently building a website for a cinema - and a cinema week runs from Thursday, 
to Wednesday.

I need some help with how to get PHP to work with one week periods, but having the 
week starting on a Thursday, instead of Sunday, or Monday.


The week will be used to generate dynamic list boxes, and database queries...  

Anyone done anything like this before that may be able to shed a little light? 

If anyone is experienced with this sort of date manipulation let me know what info 
you need and I will provide it where possible.

Cheers,


Matt



Re: [PHP-DB] making my own week? :)

2003-01-15 Thread Ignatius Reilly
The simplest seems to store the date normally in the DB.

When you need your special Cinema date, just do a modulo 7:
myDayOfWeek = ( WEEKDAY( '2003-01-17' ) + 3 ) % 7

HTH
Ignatius

- Original Message -
From: Matthew Nock [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 11:45 AM
Subject: [PHP-DB] making my own week? :)


Hi All,

I am currently building a website for a cinema - and a cinema week runs from
Thursday, to Wednesday.

I need some help with how to get PHP to work with one week periods, but
having the week starting on a Thursday, instead of Sunday, or Monday.


The week will be used to generate dynamic list boxes, and database
queries...

Anyone done anything like this before that may be able to shed a little
light?

If anyone is experienced with this sort of date manipulation let me know
what info you need and I will provide it where possible.

Cheers,


Matt



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




[PHP-DB] Undefined index and variables

2003-01-15 Thread Fred Wright
Hi to all
Being new to PHP I am naturally experiencing some minor problems.

I have a form which processes Ref and Chassis data, when I load Add.php
which does work but on loading get errors

Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
Notice: Undefined index: Chassis in C:\Xitami\webpages\add.php on line 23
How do I get rid of these undefined errors? Could anyone advise please.
Regards
Fred

printf(FORM action=\add.php\ METHOD=post);

printf(TABLE border=\0\ width=\100%%\);

printf(TRTDReference:/TD);

printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);

printf(TRTDChassis:/TD);
printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);

printf(/TABLE);

printf(INPUT TYPE=submit name=\submit\);

printf(/FORM );



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




[PHP-DB] Outgoing mail problem.

2003-01-15 Thread Antônio Pires de Castro Jr.
Friends,

I have a RedHat 7.3. I am having problems to send email. I know, I must 
config the php.ini. What are the configurations, that i need to setup?
My php.ini has an smtp entry, but no sendmail or qmail is running on the 
local machine. Do I have to have one running? I wish I did not have to 
do it. Any other way to fix this issue?

thanks in advanced,
Antonio.


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



Re: [PHP-DB] how made php on FreeBSD connect to Oracle 8.1.5 on Windows 2000 server

2003-01-15 Thread Cedar John
Thank you!But the oracle client is too big to fix my box.My box is P575+24M
RAM and can't run X-windows and don't have a CD-ROM driver.:(
Are there any simple ways such as to copy the library needed?

Jadiel Flores [EMAIL PROTECTED] дÈëÏûÏ¢ÐÂÎÅ
:[EMAIL PROTECTED]
 You have to install the Oracle Client in your FreeBSD server in order to
 compile php with the -with-oci8=[ORA_PATH] that's why it didn't work

 At 09:24 PM 1/14/2003 +0800, Cedar John wrote:
 Hi!I am a newbie.
 I've got a system with FreeBSD_4.7_release+apache_1.3.27+php_4.2.3.
 I want access oracle 8i(8.1.5) on another server with my php.
 It says that 'can not find the lib' when I complied it with
'--with-oci8'.
 What can I do?Where can I find 'the lib'(oracle oci8 library)?
 Thanks a lot!
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 Jadiel Flores
 -
 http://www.abargon.com
 [EMAIL PROTECTED]
 (52-55) 52-29-80-34





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




RE: [PHP-DB] Undefined index and variables

2003-01-15 Thread Hutchins, Richard
It does not appear that you have posted the code from the add.php page in
your original post (below). From the error messages you provided, that seems
to be where the error is happening. You'll need to post the add.php code and
identify line #23 for us to be able to help.

 -Original Message-
 From: Fred Wright [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 15, 2003 6:57 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Undefined index and variables
 
 
 Hi to all
 Being new to PHP I am naturally experiencing some minor problems.
 
 I have a form which processes Ref and Chassis data, when I 
 load Add.php
 which does work but on loading get errors
 
 Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
 Notice: Undefined index: Chassis in 
 C:\Xitami\webpages\add.php on line 23
 How do I get rid of these undefined errors? Could anyone 
 advise please.
 Regards
 Fred
 
 printf(FORM action=\add.php\ METHOD=post);
 
 printf(TABLE border=\0\ width=\100%%\);
 
 printf(TRTDReference:/TD);
 
 printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);
 
 printf(TRTDChassis:/TD);
 printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
 
 printf(/TABLE);
 
 printf(INPUT TYPE=submit name=\submit\);
 
 printf(/FORM );
 
 
 
 -- 
 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] Outgoing mail problem.

2003-01-15 Thread Ruprecht Helms
Hi  Antônio Pires de Castro Jr.,

 Friends,
 
 I have a RedHat 7.3. I am having problems to send email. I know, I must 
 config the php.ini. What are the configurations, that i need to setup?

The path to your sendmailwrapper. I think in the case of qmail you have
to write /var/qmail/bin/qmail-inject at the line of the sendmail-configuration.
I have to say I've not tested the entry, because at moment I have no mailforms
running in my local environment and no specific entry in my php.ini.

Regards,
Ruprecht


--
Ruprecht Helms IT-Service und Softwareentwicklung

Tel/Fax.:  +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:  [EMAIL PROTECTED]
--

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




Re: [PHP-DB] db connect probs

2003-01-15 Thread Doug Thompson
MySQL cannot find the username in its grant tables.

The error message very clearly states that there is no user named
'x,@host' which is the value of your $user variable.  For your example,
$email == 'x' and $femail == '@host'.  The comma is included because it
is part of the literal string, i.e., inside the double quotes.

hth,
Doug

On Tue, 14 Jan 2003 22:08:11 -0600, Addison Ellis wrote:

hello,
   do you have any idea why the following(line 106)would return 
the following
error message ?  the login.php has an included form to create an 
account and that is what will not connect.

$connection = mysql_connect($host, $user,$password) //this is line 106

Warning: Access denied for user: 'x,@host' (Using password: YES) in 
/users/infoserv/web/register/login.php on line 106

Warning: MySQL Connection Failed: Access denied for user: 'x,@host' 
(Using password: YES) in /users/infoserv/web/register/login.php on 
line 106
Couldn't connect to server.

my required file is as follows:
?
  $user=$email,$femail;
  $host=$hostname;
  $password=password('$password'),password('$fpassword');
  $database=$classes;
?


thank you again for your time. addison
-- 
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]



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




[PHP-DB] Concatenate two strings

2003-01-15 Thread Bruno Pereira
How can i join two strings.
My code is something like:
$valor1=bruno;
$valor2=Pereira;
$valor=$valor1 +   + $valor2

Can someone help me. Thanks.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]


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




RE: [PHP-DB] Concatenate two strings

2003-01-15 Thread Snijders, Mark
with a dot

$valor=$valor1 .   . $valor2

:-)





-Original Message-
From: Bruno Pereira [mailto:[EMAIL PROTECTED]]
Sent: woensdag 15 januari 2003 15:48
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Concatenate two strings


How can i join two strings.
My code is something like:
$valor1=bruno;
$valor2=Pereira;
$valor=$valor1 +   + $valor2

Can someone help me. Thanks.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]


-- 
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] Concatenate two strings

2003-01-15 Thread Ford, Mike [LSS]
 -Original Message-
 From: Bruno Pereira [mailto:[EMAIL PROTECTED]]
 Sent: 15 January 2003 14:48
 
 How can i join two strings.
 My code is something like:
 $valor1=bruno;
 $valor2=Pereira;
 $valor=$valor1 +   + $valor2
 
 Can someone help me. Thanks.

http://www.php.net/manual/en/language.operators.string.php

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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




Re: [PHP-DB] Concatenate two strings

2003-01-15 Thread Pierre-Alain Joye
On Wed, 15 Jan 2003 14:47:59 -
Bruno Pereira [EMAIL PROTECTED] wrote:

 How can i join two strings.
 My code is something like:
 $valor1=bruno;
 $valor2=Pereira;
 $valor=$valor1 +   + $valor2

 $valor=$valor1 .   . $valor2;

See  http://www.php.net/manual/pt_BR/language.operators.string.php

hth

pier

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




[PHP-DB] Missing LDAP objects

2003-01-15 Thread John_Hoge
I am using Netware 6 as an LDAP server and running Apache  PHP 4.2.2 on a
linux Redhat 7.2.
For some reason when I do a wildcard (ou=*) LDAP_SEARCH I only get part of
the directory.

I then did a LDAP_SEARCH on the CNs in the OUs that the LDAP_SEARCH did not
find, and the
LDAP_SEARCH found all the CNs.  Very Strange

Does anyone have any ideas why this is happening?

also
I tried Terrence Miao's LDAPExplorer and his PHP script only shows part of
the tree. ( exactly like mine).
I also tried a java LDAP explorer and I could see the entire tree.

Here is the code.
Our LDAP server has two OUs under the O and only one is displayed.
?php
// Connecting to LDAP server
$ds=ldap_connect(Novell server);
echo connect result is .$ds.p;

if ($ds) {
echo Binding ...;
$r=ldap_bind($ds); // anonymous bind, typically
echo Bind result is .$r.p;

echo Searching for (ou=*) ...;
// Search Organization Unit entry
$sr=ldap_search($ds,o=OurOrg, ou=* );
echo Search result is .$sr.p;
echo Number of entires returned is .ldap_count_entries
($ds,$sr).p;
echo Getting entries ...p;
$info = ldap_get_entries($ds, $sr);
echo Data for .$info[count]. items returned:p;
for($i=0;$i$info[count];$i++)
   {
  echo $info[$i][dn];
  $parts=explode(,,$info[$i][dn]);
  $nds=explode(=,$parts[0]);
  echo brnds: .$nds[1].br;
}

echo Closing connection;
ldap_close($ds);

} else {
echo h4Unable to connect to LDAP server/h4;
}
?

Thanks!



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




[PHP-DB] $user=$email

2003-01-15 Thread Addison Ellis
hello,
	i am trying to do the following:
case login:  
  $connection = mysql_connect($host, $user,$password)   //15   
   or die (Couldn't connect to server.);
  $db = mysql_select_db($database, $connection)
  or die (Couldn't select database.);

  $sql = SELECT email FROM accounts 
  WHERE email='$email';
  $result = mysql_query($sql)
  or die(Couldn't execute query.);
  $num = mysql_num_rows($result);  
  if ($num == 1)  // login name was found   //25 
  {
 $sql = SELECT email FROM accounts  
 WHERE email='$email'
 AND password=password('$password');
 $result2 = mysql_query($sql)
   or die(Couldn't execute query.);
 $num2 = mysql_num_rows($result2);
 if ($num2  0)  // password is correct
 {
$auth=yes; 
//35   
   $user=$email;
   $today = date(Y-m-d h:m:s);   
   $sql = INSERT INTO login (loginName,loginTime)
   VALUES ('$email','$today');
   mysql_query($sql) or die(Can't execute query.);
   header(Location: cat_ad.php);
 }
 else// password is not correct
 {

	in my config.php file which is a required file i have 
$user=$email, etc.
i continually receive an access denied/couldn't connect to server. 
i'm sure i'm leaving something out...
thank you for your time. addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] Re: Undefined index and variables

2003-01-15 Thread Fred Wright
?
//This is lines 22 and 23 of Add.php
require(common.php) ;
GenerateHTMLForm();
$smt2= $_POST['Ref'];  //line 22
$smt3=$_POST['Chassis']; //line 23

The form below is in common.php

function GenerateHTMLForm() {

printf(FORM action=\add.php\ METHOD=post);

printf(TABLE border=\0\ width=\100%%\);

printf(TRTDReference:/TD);
printf(TDINPUT TYPE=text SIZE=5 NAME=Ref/TD/TR);

printf(TRTDChassis:/TD);
printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
 printf(/TABLE);
 printf(INPUT TYPE=submit name=\submit\);
 printf(/FORM );
}

Fred Wright [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi to all
 Being new to PHP I am naturally experiencing some minor problems.

 I have a form which processes Ref and Chassis data, when I load Add.php
 which does work but on loading get errors

 Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
 Notice: Undefined index: Chassis in C:\Xitami\webpages\add.php on line 23
 How do I get rid of these undefined errors? Could anyone advise please.
 Regards
 Fred

 printf(FORM action=\add.php\ METHOD=post);

 printf(TABLE border=\0\ width=\100%%\);

 printf(TRTDReference:/TD);

 printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);

 printf(TRTDChassis:/TD);
 printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);

 printf(/TABLE);

 printf(INPUT TYPE=submit name=\submit\);

 printf(/FORM );





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




[PHP-DB] Date math functions...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
I have a question about using DATE_ADD in MySQL.  I am not sure if
this is the most effective way of dealing with this problem so I am asking
here.  The situation is that I am working on modifying a calendar system for
our use.  Our On-Call rotation is such that when someone is On-Call over the
weekend they automatically get Monday off.  I have created a page to
simplify inputting the On-Call schedule into the calendar system, and now I
want the Monday off to be automagically scheduled when a weekend On-Call is
entered.  The way that I see for doing this is adding 1 day to the end date
of the weekend On-Call and using that as the input for the day off
scheduling.  Here is a bit of what I have at this point...

if ($DailyStopYear) {
$result = mysql($DBName,SELECT (TO_DAYS('$StopDate') -
TO_DAYS('$StartDate'))) or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$dateDiff = $row[0];
}
} else {
$dateDiff = 0;
}

if ($dateDiff == 3) {
mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
said='$said') or die(mysql_error());
mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate,
INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error());

My big question is about using the DATE_ADD MySQL function inside
the INSERT statement.  Is this allowed?  If it is allowed, is it a bad idea
for some reason?  Is there a better way of doing this?  Thanks in advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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




[PHP-DB] Mail() and replies

2003-01-15 Thread Baumgartner Jeffrey
Is there any way to receive mail via PHP? 

What I am interested in doing is creating a double opt-in e-mail list
whereby someone can subscribe to an e-mail service via an on-line form. Upon
doing so, they would get a confirmation e-mail. Replying to this e-mail
would confirm the subscription and add the sender's e-mail address to the
database (MySQL). 

Doable?

Thanks,

Jeffrey Baumgartner

eBusiness Consultant - ITP Europe
http://www.itp-europe.com
[EMAIL PROTECTED]
+32 2 721 51 00


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




Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
[snip]
 if ($dateDiff == 3) {
 mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
 said='$said') or die(mysql_error());
 mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate,
 INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error());

 My big question is about using the DATE_ADD MySQL function inside
 the INSERT statement.  Is this allowed?  If it is allowed, is it a bad
idea
 for some reason?  Is there a better way of doing this?  Thanks in advance.

Sure, that's allowed. You have $StopDate in PHP, so you could do it with
some math in PHP, also, but then you'd have to worry about the end of
months, years, etc, whereas DATE_ADD will do this for you.

---John Holmes...


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




Re: [PHP-DB] Mail() and replies

2003-01-15 Thread John Krewson
I would say this can be done (-:

Run a quck search on freshmeat.net, sourceforge.net,
of course the manual http://www.php.net/manual/en/ref.mail.php,
and http://www.hotscripts.com/, just to name a few places to start.  Or 
just search for mailing list php on Google.

There are a ton of mailing list managers out there - check them out and 
then decide if you need to roll your own.  Many are free to use, and 
would at least offer some idea of where to start.




Baumgartner Jeffrey wrote:

Is there any way to receive mail via PHP?

What I am interested in doing is creating a double opt-in e-mail list
whereby someone can subscribe to an e-mail service via an on-line 
form. Upon
doing so, they would get a confirmation e-mail. Replying to this e-mail
would confirm the subscription and add the sender's e-mail address to the
database (MySQL).

Doable?

Thanks,

Jeffrey Baumgartner

eBusiness Consultant - ITP Europe
http://www.itp-europe.com
[EMAIL PROTECTED]
+32 2 721 51 00



--
John Krewson
Programmer - SWORPS


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




Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
 [snip]
  if ($dateDiff == 3) {
  mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
  said='$said') or die(mysql_error());
  mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate,
  INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error());
 
  My big question is about using the DATE_ADD MySQL function inside
  the INSERT statement.  Is this allowed?  If it is allowed, is it a bad
 idea
  for some reason?  Is there a better way of doing this?  Thanks in
advance.

 Sure, that's allowed. You have $StopDate in PHP, so you could do it with
 some math in PHP, also, but then you'd have to worry about the end of
 months, years, etc, whereas DATE_ADD will do this for you.

 ---John Holmes...

Wait... just noticed your syntax error. Don't enclose the function in single
quotes, otherwise you're trying to insert a string.

Should be:

... VALUES (DATE_ADD($StopDate,INTERVAL 1 DAY), ...

---John Holmes...


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




Re: [PHP-DB] Mail() and replies

2003-01-15 Thread 1LT John W. Holmes
 Is there any way to receive mail via PHP?

 What I am interested in doing is creating a double opt-in e-mail list
 whereby someone can subscribe to an e-mail service via an on-line form.
Upon
 doing so, they would get a confirmation e-mail. Replying to this e-mail
 would confirm the subscription and add the sender's e-mail address to the
 database (MySQL).

 Doable?

Sure, there are a couple modules in PHP that'll let you access and read your
POP3 or IMAP email. I'm sure there are some classes on phpclasses.org that
can be modified to your needs.

There are programs out there that do this already, too, if you don't want to
re-create the wheel.

---John Holmes...


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




Re: [PHP-DB] Mail() and replies

2003-01-15 Thread Ignatius Reilly
Quite doable.

Check the IMAP functions.

Ignatius

- Original Message -
From: Baumgartner Jeffrey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 5:19 PM
Subject: [PHP-DB] Mail() and replies


 Is there any way to receive mail via PHP?

 What I am interested in doing is creating a double opt-in e-mail list
 whereby someone can subscribe to an e-mail service via an on-line form.
Upon
 doing so, they would get a confirmation e-mail. Replying to this e-mail
 would confirm the subscription and add the sender's e-mail address to the
 database (MySQL).

 Doable?

 Thanks,

 Jeffrey Baumgartner

 eBusiness Consultant - ITP Europe
 http://www.itp-europe.com
 [EMAIL PROTECTED]
 +32 2 721 51 00


 --
 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] Re: Undefined index and variables

2003-01-15 Thread Hutchins, Richard
Fred,

I don't have much time today, but here is my initial assessment of what
might be going wrong with your page:

You display add.php which draws a form for data.
You submit that form to add.php (itself).
The form redraws inside the page.
You get errors when add.php looks for data in the $HTTP_POST_VARS array
because the page is fresh and that array is empty.

Problem is that there is no code to handle the data that was entered in the
first place. Once you hit submit, the add.php page is (re)drawn in its
original state - with no values in the fields. Therefore, when the
$_POST['varname'] statement looks in $HTTP_POST_VARS, there's nothing to
display so you get the Undefined Index errors. It's almost like refreshing
the page.

My advice would be to separate the code for the data entry and data handling
parts of your project into independent scripts. Use add.php to collect the
data then send the data to a php script called handleAdd.php that gets the
name/value pairs and submits them to the database. After submitting the data
to the database in handleAdd.php, forward the user back to another page
(add.php again, if you want) where they can get some kind of confirmation
the data was entered.

A further recommendation would be to provide the list with the code you gave
to me so maybe somebody else with a little more free time might be able to
assist you further. Sorry I couldn't provide any more help.

Rich

 -Original Message-
 From: Fred Wright [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 15, 2003 12:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: Undefined index and variables
 
 
 ?
 //This is lines 22 and 23 of Add.php
 require(common.php) ;
 GenerateHTMLForm();
 $smt2= $_POST['Ref'];  //line 22
 $smt3=$_POST['Chassis']; //line 23
 
 The form below is in common.php
 
 function GenerateHTMLForm() {
 
 printf(FORM action=\add.php\ METHOD=post);
 
 printf(TABLE border=\0\ width=\100%%\);
 
 printf(TRTDReference:/TD);
 printf(TDINPUT TYPE=text SIZE=5 NAME=Ref/TD/TR);
 
 printf(TRTDChassis:/TD);
 printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
  printf(/TABLE);
  printf(INPUT TYPE=submit name=\submit\);
  printf(/FORM );
 }
 
 Fred Wright [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi to all
  Being new to PHP I am naturally experiencing some minor problems.
 
  I have a form which processes Ref and Chassis data, when I 
 load Add.php
  which does work but on loading get errors
 
  Notice: Undefined index: Ref in C:\Xitami\webpages\add.php 
 on line 22
  Notice: Undefined index: Chassis in 
 C:\Xitami\webpages\add.php on line 23
  How do I get rid of these undefined errors? Could anyone 
 advise please.
  Regards
  Fred
 
  printf(FORM action=\add.php\ METHOD=post);
 
  printf(TABLE border=\0\ width=\100%%\);
 
  printf(TRTDReference:/TD);
 
  printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);
 
  printf(TRTDChassis:/TD);
  printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
 
  printf(/TABLE);
 
  printf(INPUT TYPE=submit name=\submit\);
 
  printf(/FORM );
 
 
 
 
 
 -- 
 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] Date math functions...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
Thanks.  I was noticing that it was not working.  Let me give this a
try and see how things go.

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 10:32 AM
To: 1LT John W. Holmes; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Date math functions...


 [snip]
  if ($dateDiff == 3) {
  mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
  said='$said') or die(mysql_error());
  mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate,
  INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error());
 
  My big question is about using the DATE_ADD MySQL function inside
  the INSERT statement.  Is this allowed?  If it is allowed, is it a bad
 idea
  for some reason?  Is there a better way of doing this?  Thanks in
advance.

 Sure, that's allowed. You have $StopDate in PHP, so you could do it with
 some math in PHP, also, but then you'd have to worry about the end of
 months, years, etc, whereas DATE_ADD will do this for you.

 ---John Holmes...

Wait... just noticed your syntax error. Don't enclose the function in single
quotes, otherwise you're trying to insert a string.

Should be:

... VALUES (DATE_ADD($StopDate,INTERVAL 1 DAY), ...

---John Holmes...

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




RE: [PHP-DB] Date math functions...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
Actually this is generating another error.  Now, without the single
quotes I am getting the following error:

Column 'StartDate' cannot be null

It looks like for some reason the DATE_ADD is returning a NULL
value.  Any more ideas?

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 10:32 AM
To: 1LT John W. Holmes; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Date math functions...


 [snip]
  if ($dateDiff == 3) {
  mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
  said='$said') or die(mysql_error());
  mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate,
  INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error());
 
  My big question is about using the DATE_ADD MySQL function inside
  the INSERT statement.  Is this allowed?  If it is allowed, is it a bad
 idea
  for some reason?  Is there a better way of doing this?  Thanks in
advance.

 Sure, that's allowed. You have $StopDate in PHP, so you could do it with
 some math in PHP, also, but then you'd have to worry about the end of
 months, years, etc, whereas DATE_ADD will do this for you.

 ---John Holmes...

Wait... just noticed your syntax error. Don't enclose the function in single
quotes, otherwise you're trying to insert a string.

Should be:

... VALUES (DATE_ADD($StopDate,INTERVAL 1 DAY), ...

---John Holmes...

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




[PHP-DB] Slashed being added..

2003-01-15 Thread Aaron Wolski
Hi All..
 
Quick q here as I cannot remember how to prevent this.
 
Customer is entering their name in a form that get submitted.
 
Their name is: Mike O'Neill
 
But their name is being entered like: Mike O\\\'Neill
 
This is causing his info not to be saved. How do I prevent this?
 
Any thoughts?
 
Thanks!
 
Aaron 
 



[PHP-DB] Re: Undefined index and variables

2003-01-15 Thread Fred Wright
here are the files to make add.php work. thanks to Richard Hutchins for his
answer, that I do not yet understand:-)

Fred Wright [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi to all
 Being new to PHP I am naturally experiencing some minor problems.

 I have a form which processes Ref and Chassis data, when I load Add.php
 which does work but on loading get errors

 Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
 Notice: Undefined index: Chassis in C:\Xitami\webpages\add.php on line 23
 How do I get rid of these undefined errors? Could anyone advise please.
 Regards
 Fred

 printf(FORM action=\add.php\ METHOD=post);

 printf(TABLE border=\0\ width=\100%%\);

 printf(TRTDReference:/TD);

 printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);

 printf(TRTDChassis:/TD);
 printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);

 printf(/TABLE);

 printf(INPUT TYPE=submit name=\submit\);

 printf(/FORM );




begin 666 Fred.zip
M4$L#!!0(`-L)+RX=#XSLUP0``!$-```'861D+G!H+57;6_B.!#^
M?$C\A[DHO08IVI! 2G057?+WE;JFPJWI^JZJDQB(-J04-NHRU7][S.8Z$
M:^_34:D\FQS-CCT.]-OQ8KWDB:(/Z^6Z7JO7'WQ(PZUB+)9B3ATFXU
M8/*;/5*DO_A9AGF2@FH/EWFE)!/TZO;SX2DE$F0/6Z=D97(W_A/'5]/;N
MV (Y,WB5,P=:RC(+*'P%$=B.;JW.D'WW@)8TGBQ%/GSO75B[4Y@)=UJ[M.1
M8WFP'ZYW^#DJ:L,BU+8S$ %0F7,Y)B(!\6\1SGF\4U@]?.G*I
M)(D7*3Y\NIY.KR^EZ_P/_1$5!'Q!)IWUN_+\NV7]KR;^E,[X#.=9*H#'
M?U,+)W)Z$IRPFB9PZ.U$#;Q)*.(5YG00IW!Z0$1$00--(GX\=;X8JE
MLS*ZN*CDSRJED64!EWZ_\E8RLGWRP+*AY0F/*'6X;R/WW#5.'*Z.FFGS
ME0A8#_7$^F?QWTOGA]X$RMT;:^GE).(^Y8=J^91%6V,^I5N%L;:,=8[
M2I@Q=XUY0HDH??,_8P*$BY3X'QYBS#+V,KRUO7:[WVBYS6'UEWXXF%
M8U_J-9I@RGXJ^N\CQI\9L[ZGL:REC5P%EOBTBRJN(;E7.L[(*1_6A*8D_-
M?T_-WU+C-HTPZKO1Z7-TK!TK!*R55(K_3L#JFIG5]NC%-26DO=\87
MS.R4;_D.E4N*+ENE6N57*_*M4NN7^6.#!TJURGY/PJURVYH,KU2JY5Y?HE
MUZYR?K,D]Q-39B;8RXRO4B-IL1(P`NL\Y90)[PB@Y0^;3B-'#S#+A1'U@5Y
M0EW `^F/'\NY,?-!76Z\!N/DS*ZH#CVJKN)#7UP5931?T*MQZ39?*U771
MH*W!D08=#;H:]#3H:^ W#?(-AKP[?3BC_$$G,,\'XNY*E05N#(PTZG0U
MZG0UP#SKY%OD''N^^^\;_[X1\%%!`:/@XG 2 1(C 2@9$(C$1@)(+.
M8.2[=OS.$UH*$ L:7YIS/ FP=HG64A$G*4C2Z)DF7$ACZ=S5*RHB-KEEY
MV]RVX6QDR;$^;!^BLR#_/,\^)SAA2LELESES*C$V#=^=PD3G^,5EO^F#R$
M:JAC]%WIW95Y QB(*CAI*N8T\ //$LA`#B+^3HAVS%CEWSA'V/Y2.A
M!VG[D01 X!:=;0$5$%IN[N/MCRWG7'T+LA%-?+K#^WT9RS47?A2!#PI
M4UH)5BU=I?PAFCE%/MC3((*YU QGD@,,K!S*4`VZJ9J$7YXL[;V$'!]$
M=1@TIEFJA:-5S9,;T-\,-ES3\`7C[X_LPZSB=DF*/.J=!7@\4WLU4L
MK.\-=2T4GJ2C09X\4\:;@3-,S1^ *QPK5G=0];BC;XFTCU.C\:SF57D3
M:3[,M?-F99MN9:MV9:M69=MRRXZEJU;EJUZEJV:EEUV+5NW+;OH6[9J7/:K
MSH67I6EK4,:AMT9%#'H*Y!/8/Z!F$3,] O8=H;*'_VD$[EMAIL PROTECTED]
M2?V_]\[N\85!]=VR^UA37$38/FQW$^$`_ZDH1'P31A2/M\DR39_*WU13:6
M8A;2:79)XK1XY_QX(O__`U!+`P04 `@?R\NZ^Z]1L)``Y*0``@``
M`-O;6UO;BYP:']6FUSVD@2_NXJ_X=EL0XZT-^C9T8LX=!-NQBX$!V+K?9
MH@0:0!NA46G$VJZL__MVCR0L0#)RJU2%4L:=3]/OTPSK5'I9V?B;]M;RD*
M#/ETRNVBO(757D)HYD]]$QNP@NV8VW6/@3=A4-=NFC!ANL%EP_%JJ9
MB]-H70X6\E,FA#YFN]^VMQS7M+U1(5JJY5:4I:0VNJ9;CA@EGL$5 !J?[$
M!E!2@K'[GE$[D;5*MJW*@77W+7:DOM5K1V%[[DH-IN:6I+P]M7Q5^*GUQS
M//'@_=%I?_3'_;\GW)OJIE5$'^SY9(BX:7FB.[+=NTS:.I_-4 M/^[+`S5?
M7E?;S7:7[EW)`S4LBW;*I2LD`+W_XC9OPX)I7%S#;UN%:^G?8N/?$/9XSZ
M/C5J6AUO'IP=XU5=;5S7B?;)*5Y5FHWK%EYMC6M?4/@[6Y-)6QBTJIHM]U*
MDTNFI5KO$LXQ9)VA59X675KELJC#@+@8B4')OMZ$X//CV,LT;HP ^Y
MQGY'VM5^D?:#4TD=LC/0ANZBXIFZ52Y?EAB\$27E$GF,\#D[.*I9]!_
M;CFW!_,\B,93\?2!Q1;5D1 ZVDI*X7,#XRE#0ZJBDF\*Q?!.SA6V(5OY9=
MM;LW@/E3;]N.NV!I6JUFBW+D@;38L55S1:G5L-M,\=]4+,!E/3Q-O..'F
MD*$O[RK-6[K18[H[G$!-1VMTP4*WAIKV@/AG,/G]#50P#=BQU!MSWU,
M`1:!NVTN^;S9*$-@!D.U)KK:]=C:!4,'F%HF.OICVFF;J]!%1:I27/%!2
M4-U@YGG+BFHA6+K B!/)XR+?#JV/`,$:I!MNF*-'TU@#Z;P2D!/R[ 
MK#'A3K )FN\%708QMP.!P0?+$W]*QOB(:^C4L-)A?T'Z?B(,704F06P
M(MFR?+LJYGL?1'8*[+70BFL8A,ON !U75OQ+@PG^FP/ 4OF^WJK_^Y;6MJ
MUY_2BHI?.J6ZWZE;C\;#Y0J0FJ'@DH40UK+[[82V4H,''-#]^(NU/Z#W3#
M4*8RIHJ045GS@W%`O%E1Y/HSHBFH-3N@$CE+Z_%66-#)8]K^]XZ^22
MEOO]-V^6:P56UG9NVS$78/V4?\V5W]8:3:'ZE/'GOP_%^Z$[](H3CZ=:,
M70J].M*SRM:=U6/CU:=Z$*8(H+U,M)A`!7(PLLHE]QX?!4$(ZK5TVQDF+
M`:?8MW@J@+/06^,$]#]CHJ72?G#HJR=!%%]BP,?4'W7A'*;G1C$4-$],P
ML$!)'^BAKS$T640'K\L7%:E_C/(D_AA,V_#K@#S[248$L@E+G'(L-?B
MDPG(;ML;K6Z^%430GQ-K_6B!?.@8F4JHH(YK+E2/)'EPL._#2-E@
M;-3K32;.R\;5G9GBIQ`Y-(+H'?KC2,Y=I(,([ F%D^,9L$Y3(YSE 7G
M*#G.1:X^0X)UEP3I+CO,^\SXYSFD6G-/D.=9,Z2XWS(@O,AQ3S=SS11
M]U,@92L)*6K0::B+Q*BARH1CC@RL=JV/F6X?/2O8MX7*)TNK;+]M@'\
MP6N/.2^K0)SFYPA2X@/7QKVA:SH7OK4FOJ 66'#$$7[?IIS1QV_5]R
M;P2]UR#Z?E\05;LF83KZM5@QJVL7P[FZKJZ''!;SLXL/-[\1]::LR :3
MLBV%(_%IY%DX-]IQ;XF#N-D)+*MYF.Q:209^/=9Z\2D$/Q+*)KQ'4(YU 
M/((_EC#;4S0**RM#V23$4\1% 02=A K!3WL-;+R0@TDK6*_BA;#R'#09
MC\1]QPJ+H.(Y/O9QN\2U)DH1:DE\$M22)+ Y4TL2:R^-)//W]^E78DF$
MHZF(9QH-A$Y3$4D8\SBA1*B(96Z)-1(Y3$G8,VTBI**2,:F:A.1]ZF(
M9.RZ-A$Y344D8UNVBA9*B(9^[9-1#ZD*VA9[N-)6T_'9LK=]+NGJ:^;F
M.7A6V8P[EXZ^BX@3\4ST51$7N3`J-2\+1.)SC-WT_--7=F,YI:[
MV45KU[;:\\ZYRYLK?$;W;17-J)H/UYVP_,.V+0-]ASK83]\()]JV:$M*NT
M88G,:9O1E!R_Y/VYVD//ETCF:P;9B J$_^7_@G!8PQ33P#1T+_B8@#Z;
MH??D8(Y MRSY6N-/W37I$P8!NBOW7+'=-[:W\(G#WDQ]8[@K[] GAU+'0!+
MNZ4Y4E;]2-4`HTCDUFKVZJVXC.W4=_EQ9EV8/I%3%4_BY=V[[:UWX+Y

RE: [PHP-DB] Slashed being added..

2003-01-15 Thread Richard Allinson
stripcslashes (string str)

Ric

-Original Message-
From: Aaron Wolski [mailto:[EMAIL PROTECTED]] 
Sent: 15 January 2003 16:38
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Slashed being added..


Hi All..
 
Quick q here as I cannot remember how to prevent this.
 
Customer is entering their name in a form that get submitted.
 
Their name is: Mike O'Neill
 
But their name is being entered like: Mike O\\\'Neill
 
This is causing his info not to be saved. How do I prevent this?
 
Any thoughts?
 
Thanks!
 
Aaron 
 

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




Re: [PHP-DB] Date math functions...

2003-01-15 Thread Jason Wong
On Thursday 16 January 2003 00:55, NIPP, SCOTT V (SBCSI) wrote:
 Actually this is generating another error.  Now, without the single
 quotes I am getting the following error:

   Column 'StartDate' cannot be null

   It looks like for some reason the DATE_ADD is returning a NULL
 value.  Any more ideas?

Which probably means your $StopDate is 0. What does it actually contain? You 
really should assign your query to some variable ($query) THEN plug it into 
your query function. If and you have any problems you can echo $query to see 
what you're passing to mysql.


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
I'm having BEAUTIFUL THOUGHTS about the INSIPID WIVES of smug and
wealthy CORPORATE LAWYERS ...
*/


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




Re: [PHP-DB] Slashed being added..

2003-01-15 Thread Jason Wong
On Thursday 16 January 2003 01:15, Richard Allinson wrote:
 stripcslashes (string str)

 Ric

 -Original Message-
 From: Aaron Wolski [mailto:[EMAIL PROTECTED]]
 Sent: 15 January 2003 16:38
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Slashed being added..


 Hi All..

 Quick q here as I cannot remember how to prevent this.

 Customer is entering their name in a form that get submitted.

 Their name is: Mike O'Neill

 But their name is being entered like: Mike O\\\'Neill

 This is causing his info not to be saved. How do I prevent this?

 Any thoughts?

Check out the magic_quotes options in php.ini.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Don't SANFORIZE me!!
*/


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




RE: [PHP-DB] Re: Undefined index and variables

2003-01-15 Thread Ben Joyce
Couldn't you use the 'for each' method on $_POST instead?

 .b

 -Original Message-
 From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] 
 Sent: 15 January 2003 16:44
 To: 'Fred Wright'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Re: Undefined index and variables
 
 
 Fred,
 
 I don't have much time today, but here is my initial 
 assessment of what might be going wrong with your page:
 
 You display add.php which draws a form for data.
 You submit that form to add.php (itself).
 The form redraws inside the page.
 You get errors when add.php looks for data in the 
 $HTTP_POST_VARS array because the page is fresh and that 
 array is empty.
 
 Problem is that there is no code to handle the data that was 
 entered in the first place. Once you hit submit, the add.php 
 page is (re)drawn in its original state - with no values in 
 the fields. Therefore, when the $_POST['varname'] statement 
 looks in $HTTP_POST_VARS, there's nothing to display so you 
 get the Undefined Index errors. It's almost like refreshing the page.
 
 My advice would be to separate the code for the data entry 
 and data handling parts of your project into independent 
 scripts. Use add.php to collect the data then send the data 
 to a php script called handleAdd.php that gets the name/value 
 pairs and submits them to the database. After submitting the 
 data to the database in handleAdd.php, forward the user back 
 to another page (add.php again, if you want) where they can 
 get some kind of confirmation the data was entered.
 
 A further recommendation would be to provide the list with 
 the code you gave to me so maybe somebody else with a little 
 more free time might be able to assist you further. Sorry I 
 couldn't provide any more help.
 
 Rich
 
  -Original Message-
  From: Fred Wright [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 15, 2003 12:21 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Re: Undefined index and variables
  
  
  ?
  //This is lines 22 and 23 of Add.php
  require(common.php) ;
  GenerateHTMLForm();
  $smt2= $_POST['Ref'];  //line 22
  $smt3=$_POST['Chassis']; //line 23
  
  The form below is in common.php
  
  function GenerateHTMLForm() {
  
  printf(FORM action=\add.php\ METHOD=post);
  
  printf(TABLE border=\0\ width=\100%%\);
  
  printf(TRTDReference:/TD);
  printf(TDINPUT TYPE=text SIZE=5 NAME=Ref/TD/TR);
  
  printf(TRTDChassis:/TD);
  printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);  
  printf(/TABLE);  printf(INPUT TYPE=submit name=\submit\);
   printf(/FORM );
  }
  
  Fred Wright [EMAIL PROTECTED] wrote in message 
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hi to all
   Being new to PHP I am naturally experiencing some minor problems.
  
   I have a form which processes Ref and Chassis data, when I
  load Add.php
   which does work but on loading get errors
  
   Notice: Undefined index: Ref in C:\Xitami\webpages\add.php
  on line 22
   Notice: Undefined index: Chassis in
  C:\Xitami\webpages\add.php on line 23
   How do I get rid of these undefined errors? Could anyone
  advise please.
   Regards
   Fred
  
   printf(FORM action=\add.php\ METHOD=post);
  
   printf(TABLE border=\0\ width=\100%%\);
  
   printf(TRTDReference:/TD);
  
   printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);
  
   printf(TRTDChassis:/TD);
   printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
  
   printf(/TABLE);
  
   printf(INPUT TYPE=submit name=\submit\);
  
   printf(/FORM );
  
  
  
  
  
  --
  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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Re: Undefined index and variables

2003-01-15 Thread Fred Wright
Of course, but that would solve the problem I have, albeit it would look
more elegant. Have tried everything except the solution which I cannot find,
see the zip file earlier up the list from Fred Wright

Ben Joyce [EMAIL PROTECTED] wrote in message
DF1220D4F915D4119C6B00306E00103E0252EDB7@IDS10004">news:DF1220D4F915D4119C6B00306E00103E0252EDB7@IDS10004...
 Couldn't you use the 'for each' method on $_POST instead?

  .b

  -Original Message-
  From: Hutchins, Richard [mailto:[EMAIL PROTECTED]]
  Sent: 15 January 2003 16:44
  To: 'Fred Wright'; [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] Re: Undefined index and variables
 
 
  Fred,
 
  I don't have much time today, but here is my initial
  assessment of what might be going wrong with your page:
 
  You display add.php which draws a form for data.
  You submit that form to add.php (itself).
  The form redraws inside the page.
  You get errors when add.php looks for data in the
  $HTTP_POST_VARS array because the page is fresh and that
  array is empty.
 
  Problem is that there is no code to handle the data that was
  entered in the first place. Once you hit submit, the add.php
  page is (re)drawn in its original state - with no values in
  the fields. Therefore, when the $_POST['varname'] statement
  looks in $HTTP_POST_VARS, there's nothing to display so you
  get the Undefined Index errors. It's almost like refreshing the page.
 
  My advice would be to separate the code for the data entry
  and data handling parts of your project into independent
  scripts. Use add.php to collect the data then send the data
  to a php script called handleAdd.php that gets the name/value
  pairs and submits them to the database. After submitting the
  data to the database in handleAdd.php, forward the user back
  to another page (add.php again, if you want) where they can
  get some kind of confirmation the data was entered.
 
  A further recommendation would be to provide the list with
  the code you gave to me so maybe somebody else with a little
  more free time might be able to assist you further. Sorry I
  couldn't provide any more help.
 
  Rich
 
   -Original Message-
   From: Fred Wright [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, January 15, 2003 12:21 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DB] Re: Undefined index and variables
  
  
   ?
   //This is lines 22 and 23 of Add.php
   require(common.php) ;
   GenerateHTMLForm();
   $smt2= $_POST['Ref'];  //line 22
   $smt3=$_POST['Chassis']; //line 23
  
   The form below is in common.php
  
   function GenerateHTMLForm() {
  
   printf(FORM action=\add.php\ METHOD=post);
  
   printf(TABLE border=\0\ width=\100%%\);
  
   printf(TRTDReference:/TD);
   printf(TDINPUT TYPE=text SIZE=5 NAME=Ref/TD/TR);
  
   printf(TRTDChassis:/TD);
   printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
   printf(/TABLE);  printf(INPUT TYPE=submit name=\submit\);
printf(/FORM );
   }
  
   Fred Wright [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi to all
Being new to PHP I am naturally experiencing some minor problems.
   
I have a form which processes Ref and Chassis data, when I
   load Add.php
which does work but on loading get errors
   
Notice: Undefined index: Ref in C:\Xitami\webpages\add.php
   on line 22
Notice: Undefined index: Chassis in
   C:\Xitami\webpages\add.php on line 23
How do I get rid of these undefined errors? Could anyone
   advise please.
Regards
Fred
   
printf(FORM action=\add.php\ METHOD=post);
   
printf(TABLE border=\0\ width=\100%%\);
   
printf(TRTDReference:/TD);
   
printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);
   
printf(TRTDChassis:/TD);
printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);
   
printf(/TABLE);
   
printf(INPUT TYPE=submit name=\submit\);
   
printf(/FORM );
   
   
  
  
  
   --
   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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] export query

2003-01-15 Thread Doug Parker
I need to essentially take a query and make it into a table.  I'll first 
 settle for the ability to export the query into a text file, somehow 
delimited.

Can anyone help me with this?


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



Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
   mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE
   said='$said') or die(mysql_error());
   mysql($DBName,INSERT INTO Log VALUES(DATE_ADD($StopDate,
   INTERVAL 1 DAY,'',1,2,'$CalendarDetailsID')) or die(mysql_error());

 Actually this is generating another error.  Now, without the single
 quotes I am getting the following error:

 Column 'StartDate' cannot be null

 It looks like for some reason the DATE_ADD is returning a NULL
 value.  Any more ideas?

Are you sure $StopDate has a value and is in the right format? Echo out your
query to the screen when you get an error, so you can look for obvious
mistakes.

Is this just example code?  You're using a function called mysql(), which
isn't standard.

---John Holmes...


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




[PHP-DB] áéíóúÁÉÍÓÚñÑ

2003-01-15 Thread Bernain, Fernando G.
How can I query this characters 'áéíóúÁÉÍÓÚñÑ' from a MSSQL DB with PHP???
Actually I obtain this: ' '¡¢£µÖà餥'!!!

Thanks

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]





Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


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




[PHP-DB] Duplicate keys...

2003-01-15 Thread NIPP, SCOTT V (SBCSI)
OK, I cannot figure out why I keep getting errors about Duplicate
entry for key 1.  Someone please come to my rescue here as this is truly
kicking my but.

if ($dateDiff == 2) {
mysql($DBName,INSERT INTO phpCalendar_Details VALUES (
'$said','Comp day for weekend
On-Call','','','','','','','','','',2,'$CalendarDetailsID')) or
die(mysql_error());

mysql($DBName,UPDATE Balances SET CompEarned=CompEarned+8,
CompTaken=CompTaken+8 WHERE said='$said') or die(mysql_error());
$result = mysql($DBName,SELECT LAST_INSERT_ID() FROM
phpCalendar_Details) or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$CalendarDetailsID = $row[0];
}
mysql($DBName,INSERT INTO Log VALUES(
'$entryid','$said','Comp',DATE_ADD('$StopDate',INTERVAL 1
DAY),'Y','','Awarded for weekend On-Call','8','$CalendarDetailsID')) or
die(mysql_error());

mysql($DBName,INSERT INTO phpCalendar_Daily VALUES(
DATE_ADD('$StopDate',INTERVAL 1 DAY),'',1,2,'$CalendarDetailsID'))
or die(mysql_error());
}

if ($dateDiff  0) {
commonHeader($glbl_SiteTitle);
echo centerfont color=\red\bYour END DATE COMES BEFORE YOUR START
DATE. Please complete the form below./b/font/centerp\n\n;

} elseif ($Stop != 1) {

if ($CalendarDetailsID) {
$CalendarDetailsID = $CalendarDetailsID + 1;
} else {
$result = mysql($DBName,SELECT LAST_INSERT_ID() FROM
phpCalendar_Details) or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$CalendarDetailsID = $row[0];
}
}

mysql($DBName,INSERT INTO phpCalendar_Details VALUES (
'$said','On-Call for $StartDate to
$StopDate','','','','','','','','','',1,'$CalendarDetailsID')) or
die(mysql_error());

mysql($DBName,INSERT INTO phpCalendar_Daily VALUES(
'$StartDate','$StopDate','1','1','$CalendarDetailsID')) or
die(mysql_error());

This is the only place in the script that is attempting to enter
data into the CalendarDetailsID field.  This is the auto_increment field
that is having problems, I think.  The other strange part of this is that
thedata in the auto_increment field has two separate ranges (10 - 40 with
gaps, and 70 - 78 with gaps).  I have been doing a lot of adding and
removing of data to test during development, but I thought an auto_increment
field would still track and deal with this correctly.
Thank again for the help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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




[PHP-DB] Problem w/ generating png on Linux with more than 250 objects ona single graphic

2003-01-15 Thread Robert Trembath
I have an application that records DNA fingerprints(gel images) in 
digital form in a MySQL Database. Each fingerprint consists of an array 
of 2000 values between 0-255 that represent a grayscale color. I use the 
code below to create an image or fingerprint from the data.

code
---
$y3 = array( 2000 values from MySQL resulta formatted );
//set positions and draw image
$pos1 = 225;
$pos2 = 226;
$pic=ImageCreate(2290,50);
$col1=ImageColorAllocate($pic,200,200,200);
foreach ($y3 as $val)
   {
   unset( $color );
   $color = ( 255 - $val);
   //$color = $value;
   $col=ImageColorAllocate($pic,$color,$color,$color);
   Imageline($pic,$pos1,6,$pos1,44,$col);
   $pos1++;
   }
ImagePNG($pic,../images/bar$ID.png);
ImageDestroy($pic);

I've check the array for min,max and number of values and the array data 
is great. It starts drwing the image which consists of  a gray 
background  and a line being drawn for each value as it loop though the 
2000 values in the array, each having a different color value and a 
position that places the each line next to the last generates the 
correct Imageline() statement on the fly.

Here's the problem, after about drawing 250 or so line objects, it stops 
drawing the values and I get nothing but gray or white for the rest of 
the image. I reduced the dataset to 400 values to test this and I get 
the same result.

Is there a limitation in GD or PHP that would cause this or is there an 
error in my code. I've attached copies of the images that PHP is 
generating so you can see what is happening. These images contain the 
curve and two images PHP draws, the first is a line graph  from JPGraph 
showing the curve and the second is the gel image below the graph. The 
gel image in the fingerprint I am having trouble with. Both example stop 
generating line objects after about 250 lines as seen in the examples.

Attachments:
sample1.gif  --  zoom in of first 400 points of sample in sample2.gif 
containing only 400 values
sample2.gif  --  entire DNA fingerprint of 2000 values

My configuration is:
Red Hat 7.3 with all current updates for that release apache 1.3 and PHP 
4.1.2

Any ideas on how to get this to work properly?

Thanks in advance for your help and advise!
Robert Trembath
CSE
e| [EMAIL PROTECTED]
Bacterial BarCodes, Inc.
Houston, TX


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


[PHP-DB] Links to samples from Problem w/ generating png on Linux

2003-01-15 Thread Robert Trembath
The images were stripped on my post but here's an external link to the 
images I refer to:

Sample1 : http://linux.diversilab.com/sample1.gif
Sample2 : http://linux.diversilab.com/sample2.gif

Thanks,
Robert



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



[PHP-DB] Re: Undefined index and variables

2003-01-15 Thread Fred Wright
Problem solved with
//Init variables
$HTTP_POST_VARS['Ref']=A;
etc
Thanks guys for your help
:-))

Fred Wright [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi to all
 Being new to PHP I am naturally experiencing some minor problems.

 I have a form which processes Ref and Chassis data, when I load Add.php
 which does work but on loading get errors

 Notice: Undefined index: Ref in C:\Xitami\webpages\add.php on line 22
 Notice: Undefined index: Chassis in C:\Xitami\webpages\add.php on line 23
 How do I get rid of these undefined errors? Could anyone advise please.
 Regards
 Fred

 printf(FORM action=\add.php\ METHOD=post);

 printf(TABLE border=\0\ width=\100%%\);

 printf(TRTDReference:/TD);

 printf(TDINPUT TYPE=text SIZE=5 NAME=Ref /TD/TR);

 printf(TRTDChassis:/TD);
 printf(TDINPUT TYPE=text SIZE=25 NAME=Chassis /TD/TR);

 printf(/TABLE);

 printf(INPUT TYPE=submit name=\submit\);

 printf(/FORM );





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




[PHP-DB] Apache/php will not start after upgrading Oracle from 8.1.7.3 to 8.1.7.4

2003-01-15 Thread Miguel Ward
Hi.

Just upgraded my Oracle installation from 8.1.7.3 to 8.1.7.4.

From that moment on, apache/php will not start (just hangs).

Tried 'make'ing Apache and php again but same result.

Checked oracle variables, etc and all seem to be okay (it was working fine).

Any help much appreciated since this is a critical application and don't
know what to do.

Thanks

Miguel



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




[PHP-DB] HTML + PHP

2003-01-15 Thread Sabina A. Schneider



 Hello 
everybody!!!Here am I again with problems... :-( This time I programmed 
severan php scripts embebed with HTML, but the curiosity comes when I try to see 
the scripts in a browser. In Opera it's ok, but in Mozilla and Internet Explorer 
it appears one table on the other, everything mixed up. I have most of the 
scriptsstructured as follows: a table that contains the name of the 
enterprise and the site's area and another table (theorically beneath the first 
one) withe the content of a table of my database. Both of them appear the second 
one under the first one, but mixed up. I used functions to build the code... 
What can it be? Was I clear with the problem? Otherwise I can send a screenshoot 
with the problem, but I don't think it's allowed to attach files in this 
list.


Sabina 
Alejandra Schneider[EMAIL PROTECTED]


RE: [PHP-DB] Duplicate keys...

2003-01-15 Thread John W. Holmes
   OK, I cannot figure out why I keep getting errors about
Duplicate
 entry for key 1.  Someone please come to my rescue here as this is
truly
 kicking my but.

You have a key or unique column in your table that you're trying to
insert a duplicate value into.
 
 if ($dateDiff == 2) {
   mysql($DBName,INSERT INTO phpCalendar_Details VALUES (
   '$said','Comp day for weekend
 On-Call','','','','','','','','','',2,'$CalendarDetailsID')) or
 die(mysql_error());
 
   mysql($DBName,UPDATE Balances SET CompEarned=CompEarned+8,
 CompTaken=CompTaken+8 WHERE said='$said') or die(mysql_error());
   $result = mysql($DBName,SELECT LAST_INSERT_ID() FROM
 phpCalendar_Details) or die(mysql_error());
   while ($row = mysql_fetch_row($result)) {
   $CalendarDetailsID = $row[0];
   }
   mysql($DBName,INSERT INTO Log VALUES(
   '$entryid','$said','Comp',DATE_ADD('$StopDate',INTERVAL 1
 DAY),'Y','','Awarded for weekend On-Call','8','$CalendarDetailsID'))
or
 die(mysql_error());
 
   mysql($DBName,INSERT INTO phpCalendar_Daily VALUES(
   DATE_ADD('$StopDate',INTERVAL 1
DAY),'',1,2,'$CalendarDetailsID'))
 or die(mysql_error());
 }
 
 if ($dateDiff  0) {
 commonHeader($glbl_SiteTitle);
 echo centerfont color=\red\bYour END DATE COMES BEFORE YOUR
START
 DATE. Please complete the form below./b/font/centerp\n\n;
 
 } elseif ($Stop != 1) {
 
 if ($CalendarDetailsID) {
   $CalendarDetailsID = $CalendarDetailsID + 1;
 } else {
   $result = mysql($DBName,SELECT LAST_INSERT_ID() FROM
 phpCalendar_Details) or die(mysql_error());
   while ($row = mysql_fetch_row($result)) {
   $CalendarDetailsID = $row[0];
   }
 }
 
 mysql($DBName,INSERT INTO phpCalendar_Details VALUES (
 '$said','On-Call for $StartDate to
 $StopDate','','','','','','','','','',1,'$CalendarDetailsID')) or
 die(mysql_error());
 
 mysql($DBName,INSERT INTO phpCalendar_Daily VALUES(
 '$StartDate','$StopDate','1','1','$CalendarDetailsID')) or
 die(mysql_error());
 
   This is the only place in the script that is attempting to enter
 data into the CalendarDetailsID field.  This is the auto_increment
field
 that is having problems, I think.  The other strange part of this is
that
 thedata in the auto_increment field has two separate ranges (10 - 40
with
 gaps, and 70 - 78 with gaps).  I have been doing a lot of adding and
 removing of data to test during development, but I thought an
 auto_increment
 field would still track and deal with this correctly.

If you're trying to insert a number into an auto_increment field that's
already there, you'll get this error. You should always insert a NULL
value into an auto_increment column so MySQL will handle giving it the
number itself.

Also, don't worry about the gaps. They are irrelevant. If the gaps
matter to your program, then you are coding incorrectly. The
auto_increment column is there _only_ to provide a unique identifier for
each row and nothing else. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP-DB] export query

2003-01-15 Thread John W. Holmes
 I need to essentially take a query and make it into a table.  I'll
first
   settle for the ability to export the query into a text file, somehow
 delimited.
 
 Can anyone help me with this?

What have you done so far? Do you know how to make a table?

While($row = mysql_fetch_row($result))
{ echo trtd{$row[0]}/tdtd{$row[1]}/td/tr; }

etc...

As for exporting it to a file, use SELECT * INTO OUTFILE ...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP-DB] making my own week? :)

2003-01-15 Thread John W. Holmes
 I am currently building a website for a cinema - and a cinema week
runs
 from Thursday, to Wednesday.
 
 I need some help with how to get PHP to work with one week periods,
but
 having the week starting on a Thursday, instead of Sunday, or Monday.
 
 
 The week will be used to generate dynamic list boxes, and database
 queries...
 
 Anyone done anything like this before that may be able to shed a
little
 light?
 
 If anyone is experienced with this sort of date manipulation let me
know
 what info you need and I will provide it where possible.

I think it's all kind of specific to what you want to create. 

If you want a drop down box filled with dates from the past Thursday to
the next Wednesday, for example, you can find the date of the last
Thursday with strtotime(last Thursday), I think. Figure out how many
seconds are in a day and make a little loop that adds the seconds to
what you got from strtotime() and uses date() to format it. 

What database are you using? There are many functions that most
databases provide that can help with this, too.

---John Holmes...



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




Re: [PHP-DB] HTML + PHP

2003-01-15 Thread Jason Wong
On Thursday 16 January 2003 11:43, Sabina A. Schneider wrote:
 Hello everybody!!! Here am I again with problems... :-( This time I
 programmed severan php scripts embebed with HTML, but the curiosity comes
 when I try to see the scripts in a browser. In Opera it's ok, but in
 Mozilla and Internet Explorer it appears one table on the other, everything
 mixed up. I have most of the scripts structured as follows: a table that
 contains the name of the enterprise and the site's area and another table
 (theorically beneath the first one) withe the content of a table of my
 database. Both of them appear the second one under the first one, but mixed
 up. I used functions to build the code... What can it be? Was I clear with
 the problem? Otherwise I can send a screenshoot with the problem, but I
 don't think it's allowed to attach files in this list.

Most likely your HTML is broken -- unclosed/unbalanced tags (/td, /tr, 
/table).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
When the going gets tough, the tough go grab a beer.
*/


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