[PHP-DB] PHP, MySQL and WML!

2001-01-25 Thread Kevin Connolly

Hi,
I am trying to update a MySQL database using a PHP script embeded in a WML 
page. Here is my code:
The following is register2.php:
wml
  template
  do type='prev' label='Back'
  prev/
  /do
  do type='accept' label='Accept'
  go href="#card2"/
  /do
  /template
 
  card id="register2" title="Register2"
  p
  First Name: input name="first" size="15"/br/
  Last Name: input name="last" size="15"/br/
  Address: input name="address" size="15"/br/
  Position: input name="position" size="15"/br/
  /p
  /card
 
  card id="card2" title="Registered"
  p
  ?php
 
  $db = mysql_connect("localhost", "root");
 
  mysql_select_db("mydb",$db);
 
  $sql = "INSERT INTO employees (first,last,address,position)
  VALUES ('$(first)','$(last)','$(address)','$(position)')";
 
  $result = mysql_db_query ("mydb", $sql);
 
  echo "$sql";
  ?
  /p
  /card
  /wml
 
Then I run register (to see if the database has been updated)!
  The following is register.php:
 
  /wml
 
  ?php
  // send wml headers
  header("Content-type: text/vnd.wap.wml");
  echo "?xml version=\"1.0\"?";
  echo "!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
  . " \"http://www.wapforum.org/DTD/wml_1.1.xml\"";
  ?
  wml
  template
  do type='prev' label='Back'
  prev/
  /do
  /template
  card id="register" title="Register"
  p
  ?php
  $db = mysql_connect("localhost", "root");
  mysql_select_db("mydb",$db);
  $result = mysql_query("SELECT * FROM employees",$db);
  printf("First Name: %s\nbr/", mysql_result($result,0,"first"));
  printf("Last Name: %s\nbr/", mysql_result($result,0,"last"));
  printf("Address: %s\nbr/", mysql_result($result,0,"address"));
  printf("Position: %s\nbr/", mysql_result($result,0,"position"));
 
  /p
  /card
  /wml

In the the following line:
printf("First Name: %s\nbr/", mysql_result($result,0,"first"));
the 0 is the row we want to view. Since I created an empty database this value 
is initially 0. If i run register2.php a second time I have to increment this 
0 to 1 before running register.php and so on.
You will see in register2.php that i have echied out $sql and it has the 
correct value for exammple:
INSERT INTO employees (first,last,address,position) VALUES 
('Kevin','Connolly','Somewhere','Manager')
but when I look at the database it has:
First Name:
Last Name:
Address:
Position:
instead of
First Name: Kevin
Last Name: Connolly
Address: Somewhere
Position: Manager
The reason I have
INSERT INTO employees (first,last,address,position) VALUES 
('$(first)','$(last)','$(address)','$(position)')
is because in WML variables are stored as $(first) and not just $first like in 
HTHML.
Somewhere between 
$sql = "INSERT INTO employees (first,last,address,position)
  VALUES ('$(first)','$(last)','$(address)','$(position)')";

AND
  $result = mysql_db_query ("mydb", $sql);
it seemes to loose the values of all my variables!!
I would appreciate any help anyone can be since I have been working in this 
for 2 days solid now and haven't managed to fix it (though i have managed to 
recreate it in many different ways!!)

Thank you,

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]




[PHP-DB] header-ache

2001-01-25 Thread Leo Kuiper

Ok I'm kinda new to this list so I'm very sorry for those who've heard this
question a million times.

How to get binary data (jpg file?) AND text from a database, BUT display it
on the same page?
I know the header-content-type blocks all this (either display text or jpg),
but there must be some way to do it, right?

(can you use two types (text and jpg) in the header, and choose between them
when you want? just a wild guess. or do I just have do it in a totally other
way?)

thanks, leo


-- 
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] PHP, MySQL and WML!

2001-01-25 Thread Andrew Apold

INSERT INTO employees (first,last,address,position) VALUES 
('$(first)','$(last)','$(address)','$(position)')
is because in WML variables are stored as $(first) and not just $first
like in 
HTHML.
Somewhere between 
$sql = "INSERT INTO employees (first,last,address,position)
  VALUES ('$(first)','$(last)','$(address)','$(position)')";

AND
  $result = mysql_db_query ("mydb", $sql);
it seemes to loose the values of all my variables!!
I would appreciate any help anyone can be since I have been working in this 
for 2 days solid now and haven't managed to fix it (though i have managed to 
recreate it in many different ways!!)

WML variables are not PHP variables.  The way I do this is to have get the
input in a card
like you have it then submit it to another php script that processes it just
like it would process any form data submitted.  Doing it this way they all
end up as regular php variables.

For example, gather all your data as you have it, but instead of sending it to
another card where you process it send it to a php script which handles it.
 This
script need not even be wap compliant, it can just process and that's it,
but you'd
probably want it to be to confirm that it did what it did.  In your case, 

card id="card2" title="Registered"
p
do type="accept"
go
href="myurl/process.php?first=$(first)amp;last=$(last)amp;address=$(addres
s)amp;position=$(position)"/ 
/do
/card

where myurl is the url to a script which contains something like:

?
  header("Content-type: text/vnd.wap.wml");
  echo("?xml version=\"1.0\"?\n");
  echo("!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\"\n\n");
  echo("!-- The application nmorequoter is (c) 2000 nmore.com --\n");
?
wml
head
meta forua="true" http-equiv="Cache-Control" content="max-age=0"/
/head 
card id="add" title="update database"  
p 
?
$sql = "INSERT INTO employees (first,last,address,position) VALUES
('$first','$last','$address','$position')";
$result = mysql_db_query ("mydb", $sql);

echo 'All done: '.$sql.'/br';
?
/p
/card
/wml


=
"To dwell within Samsara, however, is to
 be subject to the works of those mighty
 among dreamers."

 - Mahasamatman, in Zelazny's "Lord of Light"

Andrew Apold


-- 
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] failure notice

2001-01-25 Thread Mike

Hi. This is the qmail-send program at toye.php.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

[EMAIL PROTECTED]:
ezmlm-manage: fatal: message already has a Mailing-List header (maybe I should be a 
sublist) (#5.7.2)

[EMAIL PROTECTED]:
confirm unsubscribe from [EMAIL PROTECTED]: fatal: message already has a 
Mailing-List header (maybe I should be a sublist) (#5.7.2)

--- Below this line is a copy of the message.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 9500 invoked from network); 25 Jan 2001 01:00:14 -
Received: from unknown (HELO gull.prod.itd.earthlink.net) (207.217.121.85)
  by va.php.net with SMTP; 25 Jan 2001 01:00:14 -
Received: from michaelbowman (sdn-ar-002orportP225.dialsprint.net [63.178.64.241])
by gull.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id RAA22261;
Wed, 24 Jan 2001 17:02:39 -0800 (PST)
From: "Mike" [EMAIL PROTECTED]
Received: from toye.php.net ([198.186.203.51]) by vespasian.mspring.net (Mindspring 
Mail Service) with SMTP id t6uneg.j1o.37kbpqe for [EMAIL PROTECTED]; Wed, 24 
Jan 2001 17:57:20 -0500 (EST)
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Received: (qmail 19119 invoked by uid 1013); 24 Jan 2001 22:54:49 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Help: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Date: Wed, 24 Jan 2001 17:04:03 -0800
Message-ID: [EMAIL PROTECTED]
Content-Transfer-Encoding: quoted-printable
Delivered-To: responder for [EMAIL PROTECTED]
Received: (qmail 19105 invoked from network); 24 Jan 2001 22:54:48 -
Received: from unknown (HELO scaup.prod.itd.earthlink.net) (207.217.121.49)  by 
va.php.net with SMTP; 24 Jan 2001 22:54:48 -
Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net [63.180.14.206]) by 
scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id OAA15602; Wed, 24 Jan 
2001 14:57:10 -0800 (PST)
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
Received: from toye.php.net ([198.186.203.51]) by antoninus (Mindspring Mail Service) 
with SMTP id t6u4mr.hi5.37kbpq6 for [EMAIL PROTECTED]; Wed, 24 Jan 2001 
12:37:30 -0500 (EST)
Received: (qmail 27563 invoked for bounce); 24 Jan 2001 17:35:02 -
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Subject: confirm unsubscribe from [EMAIL PROTECTED]
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]

To confirm that you would like

   [EMAIL PROTECTED]

removed from the php-db mailing list, please send an empty reply=20
to this address:

   =
[EMAIL PROTECTED]=
hp.net

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

or click here:
=
mailto:php-db-uc.980376889.fmpafiidpfnnpmhjfink-Mike=3Dvalves-source.com@=
lists.php.net

I haven't checked whether your address is currently on the mailing list.
To see what address you used to subscribe, look at the messages you are
receiving from the mailing list. Each message has your address hidden
inside its return path; for example, [EMAIL PROTECTED] receives messages
with return path: =
php-db-return-number[EMAIL PROTECTED]

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
[EMAIL PROTECTED] and put the entire address listed above
into the "Subject:" line.


--- Administrative commands for the php-db list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

Send mail to the following for info and FAQ for this list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

Similar addresses exist for the digest list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

To get messages 123 through 145 (a maximum of 100 per request), mail:
   [EMAIL PROTECTED]

To get an index with subject and author for messages 123-456 , mail:
   [EMAIL PROTECTED]

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   [EMAIL PROTECTED]

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=3D' instead of '@') after the command word:
[EMAIL PROTECTED]

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, 

[PHP-DB] failure notice

2001-01-25 Thread Mike

Hi. This is the qmail-send program at toye.php.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

[EMAIL PROTECTED]:
ezmlm-manage: fatal: message already has a Mailing-List header (maybe I should be a 
sublist) (#5.7.2)

[EMAIL PROTECTED]:
confirm unsubscribe from [EMAIL PROTECTED]: fatal: message already has a 
Mailing-List header (maybe I should be a sublist) (#5.7.2)

--- Below this line is a copy of the message.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 9551 invoked from network); 25 Jan 2001 01:00:20 -
Received: from unknown (HELO gull.prod.itd.earthlink.net) (207.217.121.85)
  by va.php.net with SMTP; 25 Jan 2001 01:00:20 -
Received: from michaelbowman (sdn-ar-002orportP225.dialsprint.net [63.178.64.241])
by gull.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id RAA22812;
Wed, 24 Jan 2001 17:02:47 -0800 (PST)
From: "Mike" [EMAIL PROTECTED]
Received: from toye.php.net ([198.186.203.51]) by severus.mspring.net (Mindspring Mail 
Service) with SMTP id t6unep.ku9.37kbpqa for [EMAIL PROTECTED]; Wed, 24 Jan 
2001 17:57:28 -0500 (EST)
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Received: (qmail 20168 invoked by uid 1013); 24 Jan 2001 22:54:56 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Help: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Date: Wed, 24 Jan 2001 17:04:07 -0800
Message-ID: [EMAIL PROTECTED]
Content-Transfer-Encoding: quoted-printable
Delivered-To: responder for [EMAIL PROTECTED]
Received: (qmail 20142 invoked from network); 24 Jan 2001 22:54:56 -
Received: from unknown (HELO scaup.prod.itd.earthlink.net) (207.217.121.49)  by 
va.php.net with SMTP; 24 Jan 2001 22:54:56 -
Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net [63.180.14.206]) by 
scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id OAA16422; Wed, 24 Jan 
2001 14:57:23 -0800 (PST)
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
Received: from toye.php.net ([198.186.203.51]) by antoninus (Mindspring Mail Service) 
with SMTP id t6u4n2.i1j.37kbpq6 for [EMAIL PROTECTED]; Wed, 24 Jan 2001 
12:37:38 -0500 (EST)
Received: (qmail 27592 invoked for bounce); 24 Jan 2001 17:35:10 -
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Subject: confirm unsubscribe from [EMAIL PROTECTED]

Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]

To confirm that you would like

   [EMAIL PROTECTED]

removed from the php-db mailing list, please send an empty reply=20
to this address:

   =
[EMAIL PROTECTED]=
hp.net

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

or click here:
=
mailto:php-db-uc.980376896.goefmmbcgempeagphnfm-Mike=3Dvalves-source.com@=
lists.php.net

I haven't checked whether your address is currently on the mailing list.
To see what address you used to subscribe, look at the messages you are
receiving from the mailing list. Each message has your address hidden
inside its return path; for example, [EMAIL PROTECTED] receives messages
with return path: =
php-db-return-number[EMAIL PROTECTED]

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
[EMAIL PROTECTED] and put the entire address listed above
into the "Subject:" line.


--- Administrative commands for the php-db list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

Send mail to the following for info and FAQ for this list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

Similar addresses exist for the digest list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

To get messages 123 through 145 (a maximum of 100 per request), mail:
   [EMAIL PROTECTED]

To get an index with subject and author for messages 123-456 , mail:
   [EMAIL PROTECTED]

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   [EMAIL PROTECTED]

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=3D' instead of '@') after the command word:
[EMAIL PROTECTED]

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, 

[PHP-DB] failure notice

2001-01-25 Thread Mike

Hi. This is the qmail-send program at toye.php.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

[EMAIL PROTECTED]:
ezmlm responseezmlm-send: fatal: message already has a Mailing-List header (maybe I 
should be a sublist) (#5.7.2)

[EMAIL PROTECTED]:
ezmlm-manage: fatal: message already has a Mailing-List header (maybe I should be a 
sublist) (#5.7.2)

--- Below this line is a copy of the message.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 10167 invoked from network); 25 Jan 2001 01:00:32 -
Received: from unknown (HELO gull.prod.itd.earthlink.net) (207.217.121.85)
  by va.php.net with SMTP; 25 Jan 2001 01:00:32 -
Received: from michaelbowman (sdn-ar-002orportP225.dialsprint.net [63.178.64.241])
by gull.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id RAA23822;
Wed, 24 Jan 2001 17:03:01 -0800 (PST)
From: "Mike" [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Received: from toye.php.net ([198.186.203.51]) by vespasian.mspring.net (Mindspring 
Mail Service) with SMTP id t6unep.ja4.37kbpqe for [EMAIL PROTECTED]; Wed, 24 
Jan 2001 17:57:28 -0500 (EST)
Received: (qmail 19654 invoked by uid 1013); 24 Jan 2001 22:54:52 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Help: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Date: Wed, 24 Jan 2001 17:04:11 -0800
Message-ID: [EMAIL PROTECTED]
Content-Transfer-Encoding: quoted-printable
Delivered-To: responder for [EMAIL PROTECTED]
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 -
Received: from unknown (HELO scaup.prod.itd.earthlink.net) (207.217.121.49)  by 
va.php.net with SMTP; 24 Jan 2001 22:54:52 -
Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net [63.180.14.206]) by 
scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id OAA16305 for 
[EMAIL PROTECTED]; Wed, 24 Jan 2001 14:57:21 -0800 (PST)
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Subject: ezmlm response

Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]

This is a generic help message. The message I received wasn't sent to
any of my command addresses.


--- Administrative commands for the php-db list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, send a message to:
   [EMAIL PROTECTED]

Send mail to the following for info and FAQ for this list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

Similar addresses exist for the digest list:
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]

To get messages 123 through 145 (a maximum of 100 per request), mail:
   [EMAIL PROTECTED]

To get an index with subject and author for messages 123-456 , mail:
   [EMAIL PROTECTED]

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   [EMAIL PROTECTED]

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=3D' instead of '@') after the command word:
[EMAIL PROTECTED]

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: [EMAIL PROTECTED]
Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 -
Received: from unknown (HELO scaup.prod.itd.earthlink.net) =
(207.217.121.49)
  by va.php.net with SMTP; 24 Jan 2001 22:54:52 -
Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net =
[63.180.14.206])
by scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id =
OAA16305
for [EMAIL PROTECTED]; Wed, 24 Jan 2001 14:57:21 -0800 (PST)
Message-ID: 000301c08659$2f8db000$ce0eb43f@michaelbowman
From: "Mike" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: confirm unsubscribe from [EMAIL PROTECTED]
Date: Wed, 24 Jan 2001 14:58:11 -0800
MIME-Version: 1.0
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment
X-Mailer: Microsoft Outlook Express 

[PHP-DB] Call to undefined function: pg_connect(

2001-01-25 Thread Sean Weissensee

After I had to rebuild my linux server I started getting this
error while trying to connect to postgres.

This worked fine before, I first installed the stock RPM`s i.e PHP and
postgres
from the Redhat 6.2 Distribution. After getting this error I thought now is
a good opportunity to
upgrade to PHP4, I compiled php with pgsql support but still no luck ?


Sean



-- 
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] header-ache

2001-01-25 Thread php3

Addressed to: "Leo Kuiper" [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from "Leo Kuiper" [EMAIL PROTECTED] Thu, 25 Jan 2001 13:06:53 
+0100

 Ok I'm kinda new to this list so I'm very sorry for those who've
 heard this question a million times.

 How to get binary data (jpg file?) AND text from a database, BUT
 display it on the same page? I know the header-content-type blocks
 all this (either display text or jpg), but there must be some way to
 do it, right?

 (can you use two types (text and jpg) in the header, and choose
 between them when you want? just a wild guess. or do I just have do
 it in a totally other way?)

1.  When you get the text out of the db, write the image to a temp
file, and send the name of the temp file in the IMG tag.  Be
sure to close the temp file before you send the html.  Don't forget to
garbage collect the temp files when you are done with them. You can't
do it in the program that creates them.


2.  Use two separate programs.  One gets the text, the other
masquerades as a .jpg file, and does another SELECT on the database and
returns the image.  You can call it like:

   IMG src="getimage.php?show=1234"


3.  Don't bother putting the images in the database at all.  The web
server is designed to get images from the file system, and does it
well.


1 sucks, 2 is better, 3 is probably the best solution.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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]




[PHP-DB] Problems with character sets

2001-01-25 Thread magor

Hello everybody,
   I have problems concerning character sets.I use InterBase database.
I have data in columns with character set NONE, but the data is in fact in
win1250 coding. I have other columns with character set WIN1250. I want to
from these NONE columns to these WIN1250 columns, but InterBase does not let
me.





-- 
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] MEMO field in ACCESS

2001-01-25 Thread Monika Jurczak

I've got an Access dbase and one of the field is memo.
Before showing on web side, I want to convert the memo field from
Windows-1250 codding to ISO-8859-2.

With text fields I do it with below script, but with memo it doesn't
work

SCRIPT language="VBSCRIPT" RUNAT="SERVER"
const WIN = ""
const ISO  =  """

Function WIN2ISO( str )
   Dim A, B, znak
   WIN2ISO=""
   If IsNull(str) Then Exit Function
   WIN2ISO = str
   For A=1 To Len(WIN)
 WIN2ISO = Replace(WIN2ISO, Mid(WIN,A,1), Mid(ISO,A,1))
   Next
End Function
/SCRIPT



-- 
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] failure notice

2001-01-25 Thread JJeffman

The last time I sent a message to php-list-admin asking for stop this kind
of messages they took the email address off but I was fired of the list too.

Jayme.

http://www.conex.com.br/jjeffman



-Mensagem Original-
De: Jon Niola [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Enviada em: quinta-feira, 25 de janeiro de 2001 16:17
Assunto: Re: [PHP-DB] failure notice


 Could someone please block this guy's address from the list? I am getting
 sick of this crap

 At 08:00 AM 1/25/01 -0800, Mike wrote:
 Hi. This is the qmail-send program at toye.php.net.
 I'm afraid I wasn't able to deliver your message to the following
addresses.
 This is a permanent error; I've given up. Sorry it didn't work out.
 
 [EMAIL PROTECTED]:
 ezmlm responseezmlm-send: fatal: message already has a Mailing-List
header
 (maybe I should be a sublist) (#5.7.2)
 
 [EMAIL PROTECTED]:
 ezmlm-manage: fatal: message already has a Mailing-List header (maybe I
 should be a sublist) (#5.7.2)
 
 --- Below this line is a copy of the message.
 
 Return-Path: [EMAIL PROTECTED]
 Received: (qmail 10167 invoked from network); 25 Jan 2001 01:00:32 -
 Received: from unknown (HELO gull.prod.itd.earthlink.net)
(207.217.121.85)
by va.php.net with SMTP; 25 Jan 2001 01:00:32 -
 Received: from michaelbowman (sdn-ar-002orportP225.dialsprint.net
 [63.178.64.241])
  by gull.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id
  RAA23822;
  Wed, 24 Jan 2001 17:03:01 -0800 (PST)
 From: "Mike" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Received: from toye.php.net ([198.186.203.51]) by vespasian.mspring.net
 (Mindspring Mail Service) with SMTP id t6unep.ja4.37kbpqe for
 [EMAIL PROTECTED]; Wed, 24 Jan 2001 17:57:28 -0500 (EST)
 Received: (qmail 19654 invoked by uid 1013); 24 Jan 2001 22:54:52 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 List-Help: mailto:[EMAIL PROTECTED]
 List-Post: mailto:[EMAIL PROTECTED]
 List-Subscribe: mailto:[EMAIL PROTECTED]
 Date: Wed, 24 Jan 2001 17:04:11 -0800
 Message-ID: [EMAIL PROTECTED]
 Content-Transfer-Encoding: quoted-printable
 Delivered-To: responder for [EMAIL PROTECTED]
 X-Mailer: Microsoft Outlook Express 5.50.4522.1200
 Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 -
 Received: from unknown (HELO scaup.prod.itd.earthlink.net)
 (207.217.121.49)  by va.php.net with SMTP; 24 Jan 2001 22:54:52 -
 Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net
 [63.180.14.206]) by scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with
 SMTP id OAA16305 for [EMAIL PROTECTED]; Wed, 24 Jan 2001
 14:57:21 -0800 (PST)
 MIME-Version: 1.0
 Content-Type: text/plain;
  charset="us-ascii"
 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
 Subject: ezmlm response
 
 Hi! This is the ezmlm program. I'm managing the
 [EMAIL PROTECTED] mailing list.
 
 I'm working for my owner, who can be reached
 at [EMAIL PROTECTED]
 
 This is a generic help message. The message I received wasn't sent to
 any of my command addresses.
 
 
 --- Administrative commands for the php-db list ---
 
 I can handle administrative requests automatically. Please
 do not send them to the list address! Instead, send
 your message to the correct command address:
 
 To subscribe to the list, send a message to:
 [EMAIL PROTECTED]
 
 To remove your address from the list, send a message to:
 [EMAIL PROTECTED]
 
 Send mail to the following for info and FAQ for this list:
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 
 Similar addresses exist for the digest list:
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 
 To get messages 123 through 145 (a maximum of 100 per request), mail:
 [EMAIL PROTECTED]
 
 To get an index with subject and author for messages 123-456 , mail:
 [EMAIL PROTECTED]
 
 They are always returned as sets of 100, max 2000 per request,
 so you'll actually get 100-499.
 
 To receive all messages with the same subject as message 12345,
 send an empty message to:
 [EMAIL PROTECTED]
 
 The messages do not really need to be empty, but I will ignore
 their content. Only the ADDRESS you send to is important.
 
 You can start a subscription for an alternate address,
 for example "[EMAIL PROTECTED]", just add a hyphen and your
 address (with '=3D' instead of '@') after the command word:
 [EMAIL PROTECTED]
 
 To stop subscription for this address, mail:
 [EMAIL PROTECTED]
 
 In both cases, I'll send a confirmation message to that address. When
 you receive it, simply reply to it to complete your subscription.
 
 If despite following these instructions, you do not get the
 desired results, please contact my owner at
 [EMAIL PROTECTED] Please be patient, my owner is a
 lot slower than I am ;-)
 
 --- Enclosed is a copy of the request I received.
 
 Return-Path: [EMAIL PROTECTED]
 Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 -
 Received: from unknown (HELO scaup.prod.itd.earthlink.net) =
 

[PHP-DB] Limit number of persistent oci8-connections?

2001-01-25 Thread Karsten Dambekalns

Hi!

I am using PHP to connect to an Oracle 8.1.5 database. Everything works
fine, but the load on the oracle server is insanely high. So I would like to
limit the number of connections. Is there something like the mysql
max_persistent_connections statement?

TIA,
Karsten

BTW: Has some used sqlrelay and would like to share the experience?
-- 
Why do we have to hide from the police, daddy?
Because we use emacs, son. They use vi.
-
mailto:[EMAIL PROTECTED] w: http://www.k-fish.de/
gpg: http://www.k-fish.de/mykeys.gpg

 PGP signature


AW: [PHP-DB] Limit number of persistent oci8-connections?

2001-01-25 Thread Matthias Kopolt

Are you useing persistent connections (I had no real luck with them)?

How do you connect to your DB over Multi Threaded Server (MTS) or Dedicated
Server ?

I think Oracles NET8 Config has a Parameter to limit this.
Check out the MasterIndex at

http://technet.oracle.com/doc/server.815/a68826/toc.htm

mk



 -Ursprngliche Nachricht-
 Von: Karsten Dambekalns [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 25. Januar 2001 20:09
 An: PHP Database
 Betreff: [PHP-DB] Limit number of persistent oci8-connections?


 Hi!

 I am using PHP to connect to an Oracle 8.1.5 database.
 Everything works
 fine, but the load on the oracle server is insanely high. So
 I would like to
 limit the number of connections. Is there something like the mysql
 max_persistent_connections statement?

 TIA,
 Karsten

 BTW: Has some used sqlrelay and would like to share the experience?
 --
 Why do we have to hide from the police, daddy?
 Because we use emacs, son. They use vi.
 -
 mailto:[EMAIL PROTECTED] w: http://www.k-fish.de/
 gpg: http://www.k-fish.de/mykeys.gpg



-- 
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] Help with loop

2001-01-25 Thread Robert

Why does this spit out the same part over and over until it times out?

I have 2 tables in the same database

1:  bruindba ---Parts database
  specific_p   Part Number
  manufactur  ---Manufacturer
  package   ---Package in
 
2: ecomm   ---Ecommerce database
 ID ---session ID random number generated when first part is entered
 part   ---Part number

What I am trying to do is store the part numbers with the session ID in ecomm and then 
pull all of them
out with descriptions from bruindba. 

//- Get parts for this session 
// Check ecomm DB for parts by session ID ---
while ($res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db)){
  if(!$res){echo("error preforming query: " . mysql_error());exit();}   
//error trap
  $row=mysql_fetch_array($res);
  $pno=$row["part"];

  //-Get part info from bruindba  ---
  $result = mysql_query("SELECT * FROM bruindba where specific_p ='$pno'",$db);
  if(!$result){echo("error preforming query: " . mysql_error());exit();}  
//error trap
  $row=mysql_fetch_array($result);
  $spp=$row["specific_p"];
  $mfc=$row["manufactur"];
  $pkg=$row["package"];
  echo" $spp";
  echo" $pkg";
  echo" $mfc";
}


Thanks for any help you can provide   -Bob-
 



Re: [PHP-DB] Limit number of persistent oci8-connections?

2001-01-25 Thread Karsten Dambekalns

On Thu, Jan 25, 2001 at 08:22:07PM +0100, Matthias Kopolt wrote:
 Are you useing persistent connections (I had no real luck with them)?
 
 How do you connect to your DB over Multi Threaded Server (MTS) or Dedicated
 Server ?

I am just using phplib for the dirty stuff :) So I don't know exactly how
this works under the hood..

 I think Oracles NET8 Config has a Parameter to limit this.
 Check out the MasterIndex at

Well it is limited to 200 connections right now, but I would like to limit
that on the PHP side rather than on the Oracle side. Although I don't
exactly know why. It just seems right :)

Karsten
-- 
Why do we have to hide from the police, daddy?
Because we use emacs, son. They use vi.
-
mailto:[EMAIL PROTECTED] w: http://www.k-fish.de/
gpg: http://www.k-fish.de/mykeys.gpg

 PGP signature


RE: [PHP-DB] Help with loop

2001-01-25 Thread Mark Newnham

$res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db))
  if(!$res){echo("error preforming query: " . mysql_error());exit();}
//error trap
while(  $row=mysql_fetch_array($res)){
  $pno=$row["part"];


#
Mark Newnham
Application Design Associates, Inc
6021 S.Syracuse Way #302
Englewood, CO 80111, USA

http://www.adacorp.com
#



 -Original Message-
 From: Robert [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 12:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Help with loop
 
 
 Why does this spit out the same part over and over until it times out?
 
 I have 2 tables in the same database
 
 1:  bruindba ---Parts database
   specific_p   Part Number
   manufactur  ---Manufacturer
   package   ---Package in
  
 2: ecomm   ---Ecommerce database
  ID ---session ID random number generated 
 when first part is entered
  part   ---Part number
 
 What I am trying to do is store the part numbers with the 
 session ID in ecomm and then pull all of them
 out with descriptions from bruindba. 
 
 //- Get parts for this session 
 
 // Check ecomm DB for parts by session ID 
 ---
 while ($res = mysql_query("SELECT * FROM ecomm where ID 
 ='$sid'",$db)){
   if(!$res){echo("error preforming query: " . 
 mysql_error());exit();}   //error trap
   $row=mysql_fetch_array($res);
   $pno=$row["part"];
 
   //-Get part info from bruindba  
 ---
   $result = mysql_query("SELECT * FROM bruindba where 
 specific_p ='$pno'",$db);
   if(!$result){echo("error preforming query: " . 
 mysql_error());exit();}  //error trap
   $row=mysql_fetch_array($result);
   $spp=$row["specific_p"];
   $mfc=$row["manufactur"];
   $pkg=$row["package"];
   echo" $spp";
   echo" $pkg";
   echo" $mfc";
 }
 
 
 Thanks for any help you can provide   -Bob-
  
 

-- 
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] query error

2001-01-25 Thread Randy Johnson

When I run any kind of query this is the value of result  Resource id #2

Example
$result= mysql_query (" Select * from ACCT_TBL ") or die
("Error".mysql_error());

print result;


any ideas?

randy


-- 
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] Limit number of persistent oci8-connections?

2001-01-25 Thread George Schlossnagle

MaxClients inyour httpd.conf is a nice way to limit it.  :)

Karsten Dambekalns wrote:
 
 On Thu, Jan 25, 2001 at 08:22:07PM +0100, Matthias Kopolt wrote:
  Are you useing persistent connections (I had no real luck with them)?
 
  How do you connect to your DB over Multi Threaded Server (MTS) or Dedicated
  Server ?
 
 I am just using phplib for the dirty stuff :) So I don't know exactly how
 this works under the hood..
 
  I think Oracles NET8 Config has a Parameter to limit this.
  Check out the MasterIndex at
 
 Well it is limited to 200 connections right now, but I would like to limit
 that on the PHP side rather than on the Oracle side. Although I don't
 exactly know why. It just seems right :)
 
 Karsten
 --
 Why do we have to hide from the police, daddy?
 Because we use emacs, son. They use vi.
 -
 mailto:[EMAIL PROTECTED] w: http://www.k-fish.de/
 gpg: http://www.k-fish.de/mykeys.gpg
 
   
Part 1.2Type: application/pgp-signature


-- 
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] Help with loop

2001-01-25 Thread Robert

Thanks a million, works great now.

- Original Message - 
From: "Mark Newnham" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 25, 2001 1:41 PM
Subject: RE: [PHP-DB] Help with loop


 $res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db))
   if(!$res){echo("error preforming query: " . mysql_error());exit();}
 //error trap
 while(  $row=mysql_fetch_array($res)){
   $pno=$row["part"];
 
 
 #
 Mark Newnham
 Application Design Associates, Inc
 6021 S.Syracuse Way #302
 Englewood, CO 80111, USA
 
 http://www.adacorp.com
 #
 
 
 
  -Original Message-
  From: Robert [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, January 25, 2001 12:31 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Help with loop
  
  
  Why does this spit out the same part over and over until it times out?
  
  I have 2 tables in the same database
  
  1:  bruindba ---Parts database
specific_p   Part Number
manufactur  ---Manufacturer
package   ---Package in
   
  2: ecomm   ---Ecommerce database
   ID ---session ID random number generated 
  when first part is entered
   part   ---Part number
  
  What I am trying to do is store the part numbers with the 
  session ID in ecomm and then pull all of them
  out with descriptions from bruindba. 
  
  //- Get parts for this session 
  
  // Check ecomm DB for parts by session ID 
  ---
  while ($res = mysql_query("SELECT * FROM ecomm where ID 
  ='$sid'",$db)){
if(!$res){echo("error preforming query: " . 
  mysql_error());exit();}   //error trap
$row=mysql_fetch_array($res);
$pno=$row["part"];
  
//-Get part info from bruindba  
  ---
$result = mysql_query("SELECT * FROM bruindba where 
  specific_p ='$pno'",$db);
if(!$result){echo("error preforming query: " . 
  mysql_error());exit();}  //error trap
$row=mysql_fetch_array($result);
$spp=$row["specific_p"];
$mfc=$row["manufactur"];
$pkg=$row["package"];
echo" $spp";
echo" $pkg";
echo" $mfc";
  }
  
  
  Thanks for any help you can provide   -Bob-
   
  
 
 -- 
 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] query error

2001-01-25 Thread Mark Newnham

Looks fine, now retrieve the rows from the query.

 -Original Message-
 From: Randy Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 12:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] query error
 
 
 When I run any kind of query this is the value of result  
 Resource id #2
 
 Example
 $result= mysql_query (" Select * from ACCT_TBL ") or die
 ("Error".mysql_error());
 
 print result;
 
 
 any ideas?
 
 randy
 
 
 -- 
 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] insert into mysql

2001-01-25 Thread Robert

//--- Add part --
if($act=="ADD"){
$sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp'),$db";
if(! @mysql_db_query("$sql")){echo("Unable to add part.");mysql_close($db);exit();}
}

Why does this not work?



[PHP-DB] Problem with query!

2001-01-25 Thread Adrian Pitulac

Hi.
I have a problem with a mysql query!
after the query the result variable is "resource id 2"
what is wrong!

Thanks!



Re: [PHP-DB] Problem with query!

2001-01-25 Thread Mage

Hello!


 I have a problem with a mysql query!
 after the query the result variable is "resource id 2"
 what is wrong!

Nothing.
Read the manual, even the mysq_fetch_array($result) function.

Mage




-- 
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] insert into mysql

2001-01-25 Thread Dave Fudge

try this:

$db = mysql_connect(host,uid,pwd);
if($act=="ADD"){
$sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";
$res = mysql_db_query($dbname,$sql,$db);
  if(!$res){
  echo("Unable to add part.");
  mysql_close($db);
  exit();
  }
}

you didn't specify $dbname

-Original Message-
From: Robert [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 3:07 PM
To: Darryl Friesen; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] insert into mysql


It still didn't work.
just says unable to add part
$db = mysql_connect("tech2000", "wwwguest", "guest");

- Original Message -
From: "Darryl Friesen" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 25, 2001 2:02 PM
Subject: Re: [PHP-DB] insert into mysql



  //--- Add
part --
  if($act=="ADD"){
  $sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp'),$db";
  if(! @mysql_db_query("$sql")){
 echo("Unable to add part."); mysql_close($db);exit();} }
 
  Why does this not work?
 

 You're INSERT query is wrong.  Take the ',$db' off the end.

 $sql = "INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";


 - Darryl

  --
   Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
   Education  Research Technology Services, http://gollum.usask.ca/
   Department of Computing Services,
   University of Saskatchewan
  --
   "Go not to the Elves for counsel, for they will say both no and yes"



 --
 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 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] insert into mysql

2001-01-25 Thread Darryl Friesen



 It still didn't work.
 just says unable to add part

  $sql = "INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";

Another thought:  Are ID and part character data of some sort?  If not (i.e.
if ID is an int) then remove the single quotes.


- Darryl

 --
  Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
  Education  Research Technology Services, http://gollum.usask.ca/
  Department of Computing Services,
  University of Saskatchewan
 --
  "Go not to the Elves for counsel, for they will say both no and yes"



-- 
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] insert into mysql

2001-01-25 Thread Robert

They are both set as text
they store numbers and letters from this link ( it's my local development
machine )

http://tech2000/rfq.php?spp=MC68020RC12Epkg=PGAmfc=MOTact=ADDsid=583607b
a7b565b6d699da58d7c7fe9ab

- Original Message -
From: "Darryl Friesen" [EMAIL PROTECTED]
To: "Robert" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, January 25, 2001 2:26 PM
Subject: Re: [PHP-DB] insert into mysql




  It still didn't work.
  just says unable to add part

   $sql = "INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";

 Another thought:  Are ID and part character data of some sort?  If not
(i.e.
 if ID is an int) then remove the single quotes.


 - Darryl

  --
   Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
   Education  Research Technology Services, http://gollum.usask.ca/
   Department of Computing Services,
   University of Saskatchewan
  --
   "Go not to the Elves for counsel, for they will say both no and yes"



 --
 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] insert into mysql

2001-01-25 Thread Robert

Warning: Supplied argument is not a valid MySQL-Link resource in 
c:\inetpub\wwwroot\rfq.php on line 16
Unable to add part

//--- Add part --
if($act=="ADD"){
$sql="INSERT INTO ecomm (ID,part) VALUES $sql.="('$sid','$spp')";
if(! mysql_db_query('bruininv','$sql','$db')){echo("Unable to add 
part.");mysql_close($db);exit();}
}




[PHP-DB] insert in mysql

2001-01-25 Thread Robert

ignore that last one :) 
I goofed...

Still not working right though

if($act=="ADD"){
$sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";
if(! mysql_query('$sql')){echo("Unable to add part.");mysql_close($db);exit();}
}

just gives me "Unable to add part"




[PHP-DB] insert in mysql

2001-01-25 Thread Robert

This link is passed to the shopping cart type script where I want to put the spp and 
the sid into the database.

http://tech2000/rfq.php?spp=MC68020RC12Tpkg=PGAmfc=MOTact=ADDsid=583607ba7b565b6d699da58d7c7fe9ab

script language='php'

//  Connect to Database ---
$db = mysql_pconnect("tech2000", "wwwguest", "guest");
if(!$db){echo("Unable to connect to database server. Call 815-987-2775");exit();}
if(! @mysql_select_db("bruininv")){echo("Unable to select database. Call 
815-987-2775");mysql_close($db);exit();}

//--- Add part --
if($act=="ADD"){
$sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";
if(! mysql_query('$sql')){echo("Unable to add part.");mysql_close($db);exit();}
}


//---Close DB---
mysql_close($db);
/script

returns "Unable to add part".



I can manually add parts using DBTools and: 

INSERT INTO ecomm (ID,part) VALUES ('583607ba7b565b6d699da58d7c7fe9ab','MC68020RC12T')

and the search for the parts now works...
Just have to be able to add the parts and remove them from the db

I'm using ConTEXT for a text editor, works great for php!  Get it at 
http://www.fixedsys.com/context/ !!!
and it's FREE!!!