[PHP-DB] Re: Keeping the mailing list sain

2003-12-23 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Hi guys,
 
 So that I don't drive members of the mailing list insane:
 
 In Outlook XP (2002), I want to enable the Out of office feature; what
 I don't want to do is have it reply to every message posted to the PHP
 mailing list.
 
 Does anyone know how to create a rule, to do this?
 I really don't want to unsubscribe  subscribe to the list every time I
 go out of the office...
 
 Thanks,
 Gav
 
Can't tell you how to do a rule in Outhouse as I don't use it, but the 
rule would be to check the To: field to see if it contains the mailing 
list address - [EMAIL PROTECTED] for this list

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP-DB] Re: Display Mysql Result in drop down list

2003-12-23 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 
 Hi all, 
 
 Right now I'm trying to retrieve one of the column tutor_name and display al 
 the tutor's name in a drop down list. The problem now is, the drop down list 
 only manage to display 1 record from that row instead of all tutor's name 
 under tutor_name column...wonder where the problem lies??
 Hope to get some help soon.
 Below is a snip of the code: 
 Drop me a msg if anyone needs the entire code.
 
 
 
 SELECT NAME=tutor_name class=textarea
 ?
 
 
 $sql = mysql_query(SELECT DISTINCT tutor_name FROM tutor );
 if ($row = mysql_fetch_array($sql))

replace the above with
while ($row = mysql_fetch_array($sql))

If will be true, but will only produce one result. You want to iterate 
through all results, which is why you use while. It will return as many 
results as are available.

 {
  print OPTION VALUE=\$tutor_name\ SELECTED .$row
 [tutor_name]. /option;
  }
  $result = $db-query($sql);
 
 ?
 /select
 
 
 Thanks in advance =)
 
 Irin.
 

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP-DB] Re: Display Mysql Result in drop down list

2003-12-23 Thread irinchiang
Hi:

then now i'm trying to select a value from the drop down list, echo the value 
i have selected and lastly INSERT the value into DB with the following :
Below's a snippet of code:

snip
//retrieve all tutor_name from DB and display in drop down list

SELECT class=textarea name=tutor_name /
?


$sql = mysql_query(SELECT tutor_name FROM tutor );
while ($row = mysql_fetch_array($sql))
{
 print OPTION VALUE=\$tutor_name\ SELECTED .$row
[tutor_name]. /option;
 }
 $result = $db-query($sql);

?
/select

/snip

snip
***INSERT selected values into DB**
$tutor_name = $_POST[tutor_name];

$sql = INSERT INTO class (class_code, tutor_name, edu_level, timetable_day, 
timetable_time)
VALUES 
('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time');

//execute query statement
$result = $db-query($sql);

/snip


snip
*echo the value i have selected***
?
if($selected_tutor_name == $tutor_name)
echo $_POST[tutor_name];
?

/snip


Problem: I was unable to echo the value i selected from drop down as well as 
INSERT into DB...wonder where have i gone wrong???
Reali need some help here...all help are greatly appreciated =)
Thanks in advance.


Irin.

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



[PHP-DB] INSERT into 2 different tables??

2003-12-23 Thread irinchiang


Hi all:

Just wana ask is it possible to have only one form and when i submit, it 
should INSERT data into 2 diff tables??
Hope u get my idea...


Merry X'Mas!!

Irin.

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



Re: [PHP-DB] INSERT into 2 different tables??

2003-12-23 Thread mike karthauser
 Just wana ask is it possible to have only one form and when i submit, it
 should INSERT data into 2 diff tables??
 Hope u get my idea...

It is possible. You just need to do 2 single inserts to one to each table.

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ

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



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

2003-12-23 Thread mike karthauser
 What does this do?  Well I added PRE and /PRE for
 a testing purpose.
 
 It returns in the textarea PRE/PRE ...
 
 So it's skipping the HtmlSpecialChars code.  Why?

Change this:

echo textarea name='headers' cols='250'
rows='5'PRE,HtmlSpecialChars($headers[$line]),/PRE/textarea';

For

echo textarea name='headers' cols='250'
rows='5'PRE.HtmlSpecialChars($headers[$line])./PRE/textarea';

Which should display.

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ

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



[PHP-DB] password---simple questions but...

2003-12-23 Thread Hadi
Hi, all
please help me in this, Iam using MYSQL , my colomn is password varchar(12)

insert into tablepassword values ('',password('def'));

it is executed, (select * from tablepassword) showing the password is
hashed, and then to view the record using 'where' :

select * from tablepassword where password=password('def');
display empty set, how to solve this?
Thanks in advance.


Merry Christmas and Happy New Year
Hadi Tjen

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



Re: [PHP-DB] password---simple questions but...

2003-12-23 Thread John W. Holmes
Hadi wrote:

Hi, all
please help me in this, Iam using MYSQL , my colomn is password varchar(12)

insert into tablepassword values ('',password('def'));
PASSWORD() always returns a result that's 16 characters. So you should 
be using a VARCHAR(16) column.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


RE: [PHP-DB] Re: Display Mysql Result in drop down list

2003-12-23 Thread Aleks @ USA.net
Hi,

I am looking at your code and have a question, in your code you have

print OPTION VALUE=\$tutor_name\ SELECTED .$row [tutor_name].
/option; 

Doesn't the SELECTED piece mark everything listed as selected?? When you
bring up the page with the drop down list and open the source, what does it
show??

I handle this  a little differently, I create my drop down list as follows:

=== Code used 

// First I retrieve all customer information

$BB = mysql_query(SELECT * FROM customer ORDER BY CID );



// Then I create the drop down list

SELECT style=WIDTH: 410px size=1 name=Customer


?
 // Creates the Customer dropdown with the $id number
   while ($Site = mysql_fetch_array($BB)) 
  {
$Sid = $Site[CID];
$Sname = htmlspecialchars($Site[Customer]);
$SCity = htmlspecialchars($Site[City]);
$SState = htmlspecialchars($Site[State]);
$SCountry = htmlspecialchars($Site[Country]);


if($Sid == $Customer) 
{ $add = ' selected'; } else { $add = ''; } 
 
echo(option value='$Sid'$add$Sname nbsp;nbsp;nbsp; $SCity
nbsp;nbsp;nbsp; $SState nbsp;nbsp;nbsp; $SCountry /option\n);  

  }
 
?

/select

=== Code used 

This will create a drop down list where the value of the option is the sites
ID. In another part of this form, if there is a value set for $Customer,
then it will set the $add to selected. This will then make the drop down
list auto select the customer.

The code above is passed to another form for processing and is were the
insert data occurs. Using this method I can echo the form data easily

Hope this helps...

Aleks



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 23, 2003 4:33 AM
To: David Robley
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: Display Mysql Result in drop down list

Hi:

then now i'm trying to select a value from the drop down list, echo the
value i have selected and lastly INSERT the value into DB with the following
:
Below's a snippet of code:

snip
//retrieve all tutor_name from DB and display in drop down list

SELECT class=textarea name=tutor_name / ?


$sql = mysql_query(SELECT tutor_name FROM tutor ); while ($row =
mysql_fetch_array($sql)) {  print OPTION VALUE=\$tutor_name\ SELECTED
.$row [tutor_name]. /option;  }  $result = $db-query($sql);

?
/select

/snip

snip
***INSERT selected values into
DB** $tutor_name = $_POST[tutor_name];

$sql = INSERT INTO class (class_code, tutor_name, edu_level, timetable_day,
timetable_time)
VALUES
('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
);

//execute query statement
$result = $db-query($sql);

/snip


snip
*echo the value i have
selected***
?
if($selected_tutor_name == $tutor_name)
echo $_POST[tutor_name];
?

/snip


Problem: I was unable to echo the value i selected from drop down as well as
INSERT into DB...wonder where have i gone wrong???
Reali need some help here...all help are greatly appreciated =) Thanks in
advance.


Irin.

-- 
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: php mail() question

2003-12-23 Thread JeRRy

Change this:

echo textarea name='headers' cols='250'
rows='5'PRE,HtmlSpecialChars($headers[$line]),/PRE/textarea';

For

echo textarea name='headers' cols='250'
rows='5'PRE.HtmlSpecialChars($headers[$line])./PRE/textarea';

Which should display.


I tried this a few days ago.  All it outputs is the
PRE HTML tags.  even replacing the ',' with '.' .

That's what I thought would need to be done to get it
to work.  But it won't display it however it displays
in in plain text out of the box.

Feel free to download and try the script yourself. 
You can find the address from my previous posts on
this message board.  Something is obviously blocking
it for going into a text box as someone mentioned once
before.

The author is refusing to help maybe because the
author does not know a fix.  Which is odd, they wrote
the script and claim they use a similar method to
handle their mailing list bounces.  Doubtful.

Anyways, I have been redirected to try using SMTP
connection.  Does anyone know much about this usage?

Cheers!




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

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