Re: [PHP-DB] delete file contents (sorry if i posted this twice, problem with signing up)

2001-12-12 Thread Dobromir Velev

Hi,
the easiest way is to open the file in a write only mode.

$fp=fopen("/var/mail/myaccount","w");
$fclose($fp);

Here's an excerpt from http://www.php.net/manual/en/function.fopen.php

'w' - Open for writing only; place the file pointer at the beginning of the file and 
truncate the file to zero length. If the file
does not exist, attempt to create it.

Hope this helps

Dobromir Velev
Web Developer
http://www.websitepulse.com/


-Original Message-
From: DigitalKoala <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, December 11, 2001 19:09
Subject: [PHP-DB] delete file contents (sorry if i posted this twice, problem with 
signing up)


>Hi Everyone,
>
>I'm running a script that automatically reads lines from
>/var/mail/myaccount, parses the lines then insert specific items into a
>database this is in a loop
>
>What i want to do is then delete the contents of the file, but not the file
>itself...can you tell me the best way to do this?
>
>many thanks
>anna
>
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Session Question

2001-12-12 Thread Russ Michell

I would add each item's unique item id to an array and pass the array as the session 
variable. Then 
use serialize($array) and unserialze($array) to pass the array from script to script. 
You could then
loop thru the array at the checkout and insert the vars into your database.

HTH
Russ

On Tue, 11 Dec 2001 13:22:26 -0800 Chris Payne <[EMAIL PROTECTED]> wrote:

> Hi there everyone :-)
> 
> I have a question about Session usage.  I am passing data from 1 page to another via 
>the toolbar 
> (Forgot the method name, sorry :-) and then when the client clicks on "Add to 
>shopping cart" it 
> adds it into a session to store the data for checkout or to continue shopping.  My 
>question is this:
> 
> When the client goes back and selects another item, it overrides the original in the 
>session - how 
> do I get sessions to be dynamic and assisn a different value for each shopping cart 
>entry?  And 
> then how do I retrieve them?
> 
> Thanks for your help, I have learnt so much from this group.
> 
> Chris

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Mail() Not working

2001-12-12 Thread Rick Emery

The mail() function works fine.  $email must be set to you email program,
NOT an email server.

Should be something like  "/bin/sendmail".  If you don't have access to this
function, then you cannot send mail.

-Original Message-
From: Kevin J. Maynard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 10:18 PM
To: PHP List
Subject: [PHP-DB] Mail() Not working


I have been unable to get the mail() function to work.

my php.ini file has the following line in it:
SMTP = mail.attbi.com

my php script is as follows:


Every time I run this script, I receive "Mail could not be sent..."

Any thoughts?


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] pear.php

2001-12-12 Thread Rick Emery

Did you do a GOOGLE search?  I did:  http://pear.php.net/ 


-Original Message-
From: Osman Omar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 8:18 PM
To: PHP List
Subject: [PHP-DB] pear.php


Hi

where can I find pear.php

I install 'moregroupware' and comment about missing PEAR classes

thanks


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] question

2001-12-12 Thread Robert Weeks

Hi,

I'm a little stumped here, maybe I haven't had enough coffee yet...

Anyway, I have a lot of SQL queries that return one row if there is a match
and instead of having to write out something like this:

$firstname = $row["firstname"];
$lastname = $row["lastname"];
$midinitial = $row["midinitial"];
$preferredname = $row["preferredname"];
$address1 = $row["address1"];
$address2 = $row["address2"];
$city = $row["city"];
$state = $row["state"];
$zip = $row["zip"];

I thought I'd loop through the result and and get the info out like this:

$nrows = mysql_num_rows($result);
$nfields = mysql_num_fields($result);
$rowarray = mysql_fetch_row($result);

for ($i=0; $i<$nfields; $i++){
$fname = mysql_fieldname($result,$i);
$val = $rowarray[$i];
$fname = $val;
}

and then later in the page reference the values using 

Problem is this isn't working. If I echo the varibles to the page they will
print out but they wont show up in the  tags.

I tried setting the varibles to global and that still doesn't seem to work.
I know I'm missing something really simple and basic here. If someone could
give me a push in the right direction I'd appreciate it.

Thanks,

Robert


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Assistance Urgent.

2001-12-12 Thread Bzdpltd

Hi I am new to this list and need some help with PHP and MYSQL.

We have a database that has lots of fields in the table. What we are trying to do is 
get specific results, i will explain.

Basicall we need to be able to retrieve the total number of records in the database 
but for individual entries.

We have a field named: related_discipline which contains 1 of 12 different 
disciplines. So for example we have Rail which could be in the field, or Utilities and 
so on.. what we need to do is know how many of each there are in the database, I am 
still developing my knowledge of PHP and MySql so help would be appreciated. We need 
to be able to display the 12 different options that could be in that field in the 
database and how many entries there are for each option.

I would truly appreciate if someone could assist me here.

With kindest regards


Barry Zimmerman

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Assistance Urgent.

2001-12-12 Thread Russ Michell

To get the options:

$sql = "SELECT DISTINCT related_discipline FROM  ORDER BY options";

To get the total number of options:

$sql = "SELECT COUNT(related_discipline) FROM ";

To get the number of entries for each option 'RAIL' for example:

$sql = "SELECT COUNT(related_discipline) FROM  WHERE 
related_discipline='RAIL' ORDER 
BY related_discipline";

That should do it.
Russ

On Wed, 12 Dec 2001 10:06:04 EST [EMAIL PROTECTED] wrote:

> Hi I am new to this list and need some help with PHP and MYSQL.
> 
> We have a database that has lots of fields in the table. What we are trying to do is 
>get specific 
> results, i will explain.
> 
> Basicall we need to be able to retrieve the total number of records in the database 
>but for 
> individual entries.
> 
> We have a field named: related_discipline which contains 1 of 12 different 
>disciplines. So for 
> example we have Rail which could be in the field, or Utilities and so on.. what we 
>need to do is 
> know how many of each there are in the database, I am still developing my knowledge 
>of PHP and 
> MySql so help would be appreciated. We need to be able to display the 12 different 
>options that 
> could be in that field in the database and how many entries there are for each 
>option.
> 
> I would truly appreciate if someone could assist me here.
> 
> With kindest regards
> 
> 
> Barry Zimmerman
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Assistance Urgent.

2001-12-12 Thread DL Neil

Barry,

> We have a field named: related_discipline which contains 1 of 12 different 
>disciplines. So for example we have
Rail which could be in the field, or Utilities and so on.. what we need to do is know 
how many of each there are
in the database, I am still developing my knowledge of PHP and MySql so help would be 
appreciated. We need to be
able to display the 12 different options that could be in that field in the database 
and how many entries there
are for each option.


=check out the online manual.
The function required is appropriately enough called COUNT(). In order to get the 
count to apply to a particular
"discipline" use the GROUP BY and retrieve twelve counts (from one SELECT query).

=dn



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] question

2001-12-12 Thread Steve Cayford


On Wednesday, December 12, 2001, at 09:03  AM, Robert Weeks wrote:

> Hi,
>
> I'm a little stumped here, maybe I haven't had enough coffee yet...
>
> Anyway, I have a lot of SQL queries that return one row if there is a 
> match
> and instead of having to write out something like this:
>
> $firstname = $row["firstname"];
> $lastname = $row["lastname"];
> $midinitial = $row["midinitial"];
> $preferredname = $row["preferredname"];
> $address1 = $row["address1"];
> $address2 = $row["address2"];
> $city = $row["city"];
> $state = $row["state"];
> $zip = $row["zip"];
>
> I thought I'd loop through the result and and get the info out like 
> this:
>
> $nrows = mysql_num_rows($result);
> $nfields = mysql_num_fields($result);
> $rowarray = mysql_fetch_row($result);
>
> for ($i=0; $i<$nfields; $i++){
> $fname = mysql_fieldname($result,$i);
> $val = $rowarray[$i];
> $fname = $val;

Do you want $$fname = $val here? Taking the string in $fname as the name 
of a variable to which you are assigning $val.

> }
>
> and then later in the page reference the values using 
>
> Problem is this isn't working. If I echo the varibles to the page they 
> will
> print out but they wont show up in the  tags.
>
> I tried setting the varibles to global and that still doesn't seem to 
> work.
> I know I'm missing something really simple and basic here. If someone 
> could
> give me a push in the right direction I'd appreciate it.
>
> Thanks,
>
> Robert
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] OCI Query Results

2001-12-12 Thread Rankin, Randy

We are using OCI to query an Oracle DB. Everything seems to work fine (i.e;
data is returned to the browser), however, the first record of every
recordset is NOT returned. I can run the same query in SQLPlus and all
records are returned. It seems something in PHP is stripping of the first
record in the result set. Does anyone have any thoughts. I can post code
sample if needed.

Randy



Re: [PHP-DB] Mail() Not working

2001-12-12 Thread Kevin J . Maynard


On Wednesday, December 12, 2001, at 01:14 AM, Cristian Pozzer wrote:

>> my php.ini file has the following line in it:
>> SMTP = mail.attbi.com
>>
>> my php script is as follows:
>> > $email = "to_email";
>> $from = "from_email";
>> $mesg = "This is a test email. \r\n";
>>
>> if (mail($email, "Test", $mesg, $from))
>> echo "Mail Sent!";
>> else
>> echo "Mail could not be sent...";
>> ?>
>
>
> I have the same problem!
>

Snip...

> Do you have this problem on a OSX Server right?

OS X.1, I can't imagine there's much difference.

Kevin


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Mail() Not working

2001-12-12 Thread Kevin J . Maynard

On Wednesday, December 12, 2001, at 06:12 AM, Rick Emery wrote:

> The mail() function works fine.  $email must be set to you email 
> program,
> NOT an email server.
>
> Should be something like  "/bin/sendmail".  If you don't have access to 
> this
> function, then you cannot send mail.

So where would the To: address go if not $email?  I thought the proper 
syntax was:  mail(Email_Address_of_Recipient, Title_of_Email, 
Body_of_Email, Headers);

Kevin

> -Original Message-
> From: Kevin J. Maynard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 10:18 PM
> To: PHP List
> Subject: [PHP-DB] Mail() Not working
>
>
> I have been unable to get the mail() function to work.
>
> my php.ini file has the following line in it:
> SMTP = mail.attbi.com
>
> my php script is as follows:
>$email = "to_email";
>   $from = "from_email";
>   $mesg = "This is a test email. \r\n";
>   
>   if (mail($email, "Test", $mesg, $from))
>   echo "Mail Sent!";
>   else
>   echo "Mail could not be sent...";
> ?>
>
> Every time I run this script, I receive "Mail could not be sent..."


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] OCI Query Results

2001-12-12 Thread Rankin, Randy

Nevermind, I figured it out.  There was a duplicate OCIfetchinto statement
in the script.

Randy

-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 10:12 AM
To: PHP List
Cc: Barker, John
Subject: [PHP-DB] OCI Query Results


We are using OCI to query an Oracle DB. Everything seems to work fine (i.e;
data is returned to the browser), however, the first record of every
recordset is NOT returned. I can run the same query in SQLPlus and all
records are returned. It seems something in PHP is stripping of the first
record in the result set. Does anyone have any thoughts. I can post code
sample if needed.

Randy



RE: [PHP-DB] Mail() Not working

2001-12-12 Thread Rick Emery

It should look like:

$email = "/bin/sendmail";
$to = "[EMAIL PROTECTED]";
$subj = "A test message";
$body = "This is the body of the message";
$hdr = "Reply-to: [EMAIL PROTECTED]";
mail ($email, $to, $subj, $body, $hdr);

-Original Message-
From: Kevin J. Maynard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 10:33 AM
To: PHP List; Rick Emery
Subject: Re: [PHP-DB] Mail() Not working


On Wednesday, December 12, 2001, at 06:12 AM, Rick Emery wrote:

> The mail() function works fine.  $email must be set to you email 
> program,
> NOT an email server.
>
> Should be something like  "/bin/sendmail".  If you don't have access to 
> this
> function, then you cannot send mail.

So where would the To: address go if not $email?  I thought the proper 
syntax was:  mail(Email_Address_of_Recipient, Title_of_Email, 
Body_of_Email, Headers);

Kevin

> -Original Message-
> From: Kevin J. Maynard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 10:18 PM
> To: PHP List
> Subject: [PHP-DB] Mail() Not working
>
>
> I have been unable to get the mail() function to work.
>
> my php.ini file has the following line in it:
> SMTP = mail.attbi.com
>
> my php script is as follows:
>$email = "to_email";
>   $from = "from_email";
>   $mesg = "This is a test email. \r\n";
>   
>   if (mail($email, "Test", $mesg, $from))
>   echo "Mail Sent!";
>   else
>   echo "Mail could not be sent...";
> ?>
>
> Every time I run this script, I receive "Mail could not be sent..."

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] question

2001-12-12 Thread Robert Weeks

Yup,

I knew it was something really simple. I should never touch a computer 
before the coffee is brewed ;-)

Thanks!

Robert

On Wednesday, December 12, 2001, at 11:09 AM, Steve Cayford wrote:

>
> Do you want $$fname = $val here? Taking the string in $fname as the 
> name of a variable to which you are assigning $val.
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] question

2001-12-12 Thread David Piasecki

If you know what your result set is going to be, it would be easier to
do something like this:

list($firstname,$lastname,$midinitial,$preferredname,$address1,$address2
,$city,$state,$zip) = mysql_fetch_row($result);

Or if you are returning more then one row, and want to loop through the
results:

while(list($firstname,$lastname,$midinitial,$preferredname,$address1,$ad
dress2,$city,$state,$zip) = mysql_fetch_row($result)) {

// process the results as necessary...

}

-Dave

-Original Message-
From: Robert Weeks [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 12, 2001 7:03 AM
To: PHP List
Subject: [PHP-DB] question

Hi,

I'm a little stumped here, maybe I haven't had enough coffee yet...

Anyway, I have a lot of SQL queries that return one row if there is a
match
and instead of having to write out something like this:

$firstname = $row["firstname"];
$lastname = $row["lastname"];
$midinitial = $row["midinitial"];
$preferredname = $row["preferredname"];
$address1 = $row["address1"];
$address2 = $row["address2"];
$city = $row["city"];
$state = $row["state"];
$zip = $row["zip"];

I thought I'd loop through the result and and get the info out like
this:

$nrows = mysql_num_rows($result);
$nfields = mysql_num_fields($result);
$rowarray = mysql_fetch_row($result);

for ($i=0; $i<$nfields; $i++){
$fname = mysql_fieldname($result,$i);
$val = $rowarray[$i];
$fname = $val;
}

and then later in the page reference the values using 

Problem is this isn't working. If I echo the varibles to the page they
will
print out but they wont show up in the  tags.

I tried setting the varibles to global and that still doesn't seem to
work.
I know I'm missing something really simple and basic here. If someone
could
give me a push in the right direction I'd appreciate it.

Thanks,

Robert


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: Mail() Not working

2001-12-12 Thread Kevin J. Maynard

It should look like:

$email = "/bin/sendmail";
$to = "[EMAIL PROTECTED]";
$subj = "A test message";
$body = "This is the body of the message";
$hdr = "Reply-to: [EMAIL PROTECTED]";
mail ($email, $to, $subj, $body, $hdr);
--
Still no dice.  I ran a search on my HD and found that my sendmail is 
located at  /usr/sbin/sendmail  I made the necessary change in your 
script, and still nothing.

Any other ideas?  Your help is very appreciated!

Kevin



Re: [PHP-DB] Mail() Not working

2001-12-12 Thread Chris Hobbs

Ummm, you both might want to take a look at: 
http://www.php.net/manual/en/function.mail.php
as well as:
http://www.php.net/manual/en/ref.mail.php

Rick, you can't specify the mail program in any of the arguments for the 
mail() command.

Kevin, I bet your problem is in your php.ini script. Make sure 
sendmail_path is configured correctly for your server - notice that SMTP 
only has to be identified for Win32 installations. You must set 
sendmail_path correctly for this to work on *n[iu]x systems.

And for future reference, since there was no database content in the 
question, php-general would have been a better place for the question.

Rick Emery wrote:


> It should look like:
> 
> $email = "/bin/sendmail";
> $to = "[EMAIL PROTECTED]";
> $subj = "A test message";
> $body = "This is the body of the message";
> $hdr = "Reply-to: [EMAIL PROTECTED]";
> mail ($email, $to, $subj, $body, $hdr);


In response to Kevin's question:

>>> I have been unable to get the mail() function to work.
>>>
>>> my php.ini file has the following line in it:
>>> SMTP = mail.attbi.com


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Mail() Not working

2001-12-12 Thread Rick Emery

I stand corrected.  thanks

-Original Message-
From: Chris Hobbs [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 12:03 PM
To: PHP-DB List
Subject: Re: [PHP-DB] Mail() Not working


Ummm, you both might want to take a look at: 
http://www.php.net/manual/en/function.mail.php
as well as:
http://www.php.net/manual/en/ref.mail.php

Rick, you can't specify the mail program in any of the arguments for the 
mail() command.

Kevin, I bet your problem is in your php.ini script. Make sure 
sendmail_path is configured correctly for your server - notice that SMTP 
only has to be identified for Win32 installations. You must set 
sendmail_path correctly for this to work on *n[iu]x systems.

And for future reference, since there was no database content in the 
question, php-general would have been a better place for the question.

Rick Emery wrote:


> It should look like:
> 
> $email = "/bin/sendmail";
> $to = "[EMAIL PROTECTED]";
> $subj = "A test message";
> $body = "This is the body of the message";
> $hdr = "Reply-to: [EMAIL PROTECTED]";
> mail ($email, $to, $subj, $body, $hdr);


In response to Kevin's question:

>>> I have been unable to get the mail() function to work.
>>>
>>> my php.ini file has the following line in it:
>>> SMTP = mail.attbi.com


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] ociNewCollection and package

2001-12-12 Thread Olaf Taesch

Hi Sumesh,

> I didn't exactly understand what u mentioned in your email. 
> Do u mean that
> ociNewCollection is still not working?

No - it works, but not if the array - type is declared in the package...
or I make a mistake...

regards
Olaf

> 
> 
>   hello sumesh,
> 
>   no, we solved our problem with the oci not an i got no 
> answer to solved
> it. But that is not so important, because the convertion asp 
> code to php is
> canceled in the moment...
>   the links for oci i know are:
>   http://www.php-center.de/de-html-manual/ref.oci8.html
>   
> http://www.phpcenter.de/faq/faq-database_oracle.html?druckversion=yes
>   http://www.php.net/manual/en/ref.oci8.php
>   http://conf.php.net/pres/index.php?p=slides%2Foci&id=oci
> 
>   regards
>   olaf
> -Original Message-
> From: Sumesh Nair [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 22, 2001 4:37 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] ociNewCollection and package
> 
> 
> Hello,
> 
> I found your email id  on phpBuilder on your posting for [PHP-DB]
> ociNewCollection and package.
> I am sorry to contact you directly but I have done so 
> because I have not
> been successful in finding any solution to the OCITypeByName: 
> OCI-22303:
> type problem. Have you solved the problem of ociNewCollection.
> 
> If so pl. let me know or if u have some documentation it 
> would be if I
> could have a look.
> 
> Thanking u in advance
> 
> Sumesh
> 
> Sumesh Nair
> Frontend Developer, Flytxt Ltd.
> 5-15 Cromer St. London WC1H 8LS
> [EMAIL PROTECTED]
> www.flytxt.com
> t: +44-207-841-6410
> f: +44-207-841-6444
> m: +44 781-071-8822
> 
> 
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] return parameters for stored procedures with sql server 7 using odbc

2001-12-12 Thread Ian Ferger

i am converting an existing asp site over to php (noble cause) and i am
using odbc as my connection layer. i have no problem with statements, but
difficulties with stored procs.
the following is one of the statements i am trying to convert:


  Set cmdSub = Server.CreateObject("ADODB.Command")
  With cmdSub
   .ActiveConnection = DBConn

   .CommandText = "sp_edit_UtilCorp"
   .CommandType = 4 ' - adCmdStoredProc
   .Parameters("@UTILCORP_ID") = UTILCORP_ID
   .Parameters("@CoName") = CoName
   .Parameters("@Add1") = Add1
   .Parameters("@Add2") = Add2
   .Parameters("@City") = City
   .Parameters("@State") = State
   .Parameters("@Zip") = Zip
   .Parameters("@Tel") = Tel
   .Parameters("@Fax") = Fax
   .Parameters("@Email") = Email
   .Parameters("@ContactName") = ContactName
   .Execute

   edit_status = .Parameters("@RETURN_VALUE")
  End With


i found this under odbc_execute, but it supposedly is unable to give a
return value:

$stmt=odbc_prepare($conn_id, "exec my_proc_name ?,?,?");
$parms=array("fred","password",5);
if (!odbc_execute($stmt, &$parms)) die("odbc_execute failed");

is it possible to change this to both: explicitly pass the parameters by
name and pass the return value to a variable?

thx
Ian Ferger




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Data -> countinents, countries, provinces, cities >10.000

2001-12-12 Thread Andy

Hi there,

I am building a travel portal and I can't get data for the registration.

Does anybody have, or know where I can get this data from?

I am searching for the continents belonging to the countries, belonging to
the provinces belonging to the cities over 1.

Thanx for any help.

cheers Andy



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ODBC MS SQL 7.0 Not closing connection

2001-12-12 Thread Eric Liedtke

I am not sure where this is going wrong so I am hoping to find an answer
on one of these 2 lists. I am using freetds/unixodbc in php to connect
to an MS SQL7 server. I was having some problems with the connection
hanging open, so I removed all me queries and trimmed my script down to
a simple db open and close, however my connection still stays open and
the odbc_close() fails. Here is the script...


\n");
   odbc_close($mydbhandle) or die("Could not close db connection");
?>
Any ideas on where to look? Thanks for the time

Eric Liedtke


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: question

2001-12-12 Thread Dan Fitzpatrick

Robert,

The easiest way to convert result set values to the field variable names
is with one line of code:

extract(mysql_fetch_array($row));

This will set $firstname = $row["firstname"], etc.

Dan

-- 
~~~
 Dan Fitzpatrick
 Overhaul Search
 http://www.overhaulsearch.com
 mailto:[EMAIL PROTECTED]
~~~

Robert Weeks wrote:
> 
> Hi,
> 
> I'm a little stumped here, maybe I haven't had enough coffee yet...
> 
> Anyway, I have a lot of SQL queries that return one row if there is a match
> and instead of having to write out something like this:
> 
> $firstname = $row["firstname"];
> $lastname = $row["lastname"];
> $midinitial = $row["midinitial"];
> $preferredname = $row["preferredname"];
> $address1 = $row["address1"];
> $address2 = $row["address2"];
> $city = $row["city"];
> $state = $row["state"];
> $zip = $row["zip"];
> 
> I thought I'd loop through the result and and get the info out like this:
> 
> $nrows = mysql_num_rows($result);
> $nfields = mysql_num_fields($result);
> $rowarray = mysql_fetch_row($result);
> 
> for ($i=0; $i<$nfields; $i++){
> $fname = mysql_fieldname($result,$i);
> $val = $rowarray[$i];
> $fname = $val;
> }
> 
> and then later in the page reference the values using 
> 
> Problem is this isn't working. If I echo the varibles to the page they will
> print out but they wont show up in the  tags.
> 
> I tried setting the varibles to global and that still doesn't seem to work.
> I know I'm missing something really simple and basic here. If someone could
> give me a push in the right direction I'd appreciate it.
> 
> Thanks,
> 
> Robert

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mssql_query, sybase_query

2001-12-12 Thread Bradley Bell

Is it just me, or is the documentation for these two functions totally wrong?
They are sopposed to return int values, either a "result identifier", or 0,
if the query fails.
However, it looks to me like it always returns a string.  If the query
returns data (i.e. a SELECT query), then it returns something like
"Resource id #2".  If the query doesn't return anything (i.e. an INSERT or
whatever), or if it fails, it returns an empty string.
So, how does one tell the difference between a failed query and a query with
no results?

-brad

P.S. Which one is broken, the docs or the implementation, and are they going
to be fixed?

-- 
Bradley Bell
Computer Support Analyst
University of Washington
Classroom Support Services

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: SQL problem is killing this newbie

2001-12-12 Thread Matthew Crouch

You need an associating table; members and movies are in a many-to-many
relationship here.
The associating table represents the act of viewing-a-movie, and describe who
and what are involved

comme ca:

"members"
memberid, name
1 Fred
2 Jack
3 Jill

"movies"
movieid, title
1 Fear and loathing
2 Monkey Town
3 PHP: The film
4 PHP: The sequel

"viewings"
viewingid, memberid, movieid
1 2 2
2 1 4
3 1 1
4 3 4
this data indicates that Jack saw "monkey town", Fred saw "Fear&Loathing" and
"PHP:The Sequel", and Jill saw only "PHP: The sequel"

Samios wrote:

> I am having a problem designing a query on a mysql 3.23 database.
>
> I have 2 tables - "member" and "movie".
> The "member" table stores the people details, the "movie" table records the
> movies they have seen (each record is one movie).
>
> MEMBER
> memberid int not null auto_increment primary key,
> membername varchar(50) not null,
> etc...
>
> MOVIE
> movieid int not null auto_increment primary key,
> movietitle varchar(50) not null,
> memberid int,
> index (memberid)
> etc...
>
> Obviously member to movie is a one-to-many relationship.
>
> I want to create a search page which will allow me to search for members who
> have watched a specified set of movies.
> i.e. I want to query the database for members who have seen "Star Trek" AND
> "Star Wars" AND "Planet of the APES".
>
> I can create a query which searches for "Star Trek" OR "Star Wars" OR
> "Planet of the Apes".
> Unfortunately the "AND" condition is causing me problems.
>
> I'm also hoping to use the "LIKE" operator in this query.
> e.g. where movietitle like "%star%".
> This will give me added flexiblity down the track.
>
> Any help would be greatly appreciated.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] you are here

2001-12-12 Thread RSalomo

russ,
i found about the article here:
http://www.zend.com/codex.php?id=414&single=1
thank you fyi
rudy

- Original Message -
> Check out the php-navigation section at hotscripts.com. I found exactly
that on there a couple of
> weeks back, it utilises cookies.
>
> Cheers
> Russ
>
> On Tue, 11 Dec 2001 23:23:02 +0700 RSalomo <[EMAIL PROTECTED]> wrote:
>
> > helo,
> >
> > i have site navigation, for example: you are here: home > music > jazz >
> > musicians.
> > i get this by put an 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]