[PHP-DB] Forgive the multiple posts... please :)

2003-08-29 Thread Allens
Having email issues with my host. Kept getting rejected email Mail 
Daemon errors from my host. Thanks Jim for letting me know that the 
list was receiving the posts. :)

:)
  Gale L. Allen Jr
  Macintosh Support Specialist
  Phone: 919/412-5039
  Homepage: http://homepage.mac.com/ateam3/Menu5.html
  iChat = [EMAIL PROTECTED]
  Remember, It's only Rock 'n Roll, but I like it!
(:

[PHP-DB] md5() and mysql

2003-08-29 Thread Mike Baerwolf
Hello,

I'm looking at using md5() and mysql for user auth to some of the data 
in a table. I found the following on the php md5 manual page,

$query = INSERT INTO user VALUES ('DummyUser',md5('DummyPassword'));

$password = md5($password);
$query = SELECT * FROM user WHERE username='DummyUser' AND 
password='DummyPassword';

I see that nobody will be able to view the password once it's in the 
database, but I'm thinking that the plain text password is sent to and 
from the server and someone might be able to snoop the plain text 
password. Is that right?

Thanks for the help,
Mike
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] md5() and mysql

2003-08-29 Thread John W. Holmes
Mike Baerwolf wrote:

I'm looking at using md5() and mysql for user auth to some of the data 
in a table. I found the following on the php md5 manual page,

$query = INSERT INTO user VALUES ('DummyUser',md5('DummyPassword'));

$password = md5($password);
$query = SELECT * FROM user WHERE username='DummyUser' AND 
password='DummyPassword';
password = '$password';

I see that nobody will be able to view the password once it's in the 
database, but I'm thinking that the plain text password is sent to and 
from the server and someone might be able to snoop the plain text 
password. Is that right?
Yes. That's why you use SSL on your login pages.

--
---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


[PHP-DB] Beta 2 of plPHP released.

2003-08-29 Thread Joshua D. Drake
Hello,

 Beta 2 of plPHP has been released. This version contains many bug 
fixes. For example, if you write bad plphp code and try to execute it, 
the code will no longer crash PostgreSQL ;).

 The URL is here: http://www.commandprompt.com/entry.lxp?lxpe=260

 There are precompiled binaries for RedHat 9.
 There are general compilation instructions.
Sincerley,

Joshua Drake


[PHP-DB] updating and displaying problem.

2003-08-29 Thread rajni arya


Hello Everyone,


  I am working on PHP and PostGREsql.My doubt is first i am
inserting my required information to the table after that i am updating
one field with same information for all the records, now i want to update
a particular record , i am able to update in database, but when i am
displaying it that particular record is missing from the display but it is
available in database. Is there any one to help me out ...i will be very
thankful to u...

thanks in advance.

with regards,

Rajni

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



[PHP-DB] weird php error

2003-08-29 Thread OpenSource
Hi guys,
 
This is weird to me..
I got this script
---
?php
 
if ($_GET[login] == 'forgot')
{
echo Sorry  I forgot my password;
}
else { echo you are good to go; }
 
?
-
when ran, it gives me this error
 

Notice: Use of undefined constant login - assumed 'login' in
G:\Inetpub\wwwroot\test\index.php on line 3
 
Notice: Undefined index: login in G:\Inetpub\wwwroot\test\index.php on
line 3 good to go
 
What is this all about?
The script look fine to me.
 
Thanks in advance for your support
 


[PHP-DB] another PHP Sql question...

2003-08-29 Thread jsWalter
I am querying a database just fine.

Getting back what I expect, just fine.

But now I've been thrown a wrench in the form of double row display.

my client wants...

a   b
c   d
e   f
   ...

Well, I've reached the end on my PHP/SQL knowledge (which really isn't all
that far!)

Right now I'm doing (very much shortened)...

   // Query the database
   $result = $db-query($strSql);

   // Always check that $result is not an error
   if (DB::isError($result))
  die ($result-getMessage());

   while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
   {
  extract ($row);
  echo $feild_A . 'br /';
   }

OK, this is fine for a straight list!

But I need to create...

   tr
  tdrow_1/feild_A/td
  tdrow_1/feild_B/td
   /tr
   tr
  tdrow_2/feild_A/td
  tdrow_2/feild_B/td
   /tr
   ...

And using the method of WHILE() doesn't cut it.

Can some one enlighten me what syntax can I use to hit 2 rows at a time?

Thanks

Walter

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



RE: [PHP-DB] another PHP Sql question...

2003-08-29 Thread Boaz Yahav
I'm not sure i understand the problem.
Do a,c,e come from one query result and b,d,f from another?
If it's all from the same query why not do :

$result=mysql_query(.
TABLE
While($row = mysql_fetch_object($result)) {
EchoTRTD$row-feild_A/TDTD$row-feild_B/TD/TR;
}
/TABLE

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: jsWalter [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2003 8:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] another PHP Sql question...


I am querying a database just fine.

Getting back what I expect, just fine.

But now I've been thrown a wrench in the form of double row display.

my client wants...

a   b
c   d
e   f
   ...

Well, I've reached the end on my PHP/SQL knowledge (which really isn't
all that far!)

Right now I'm doing (very much shortened)...

   // Query the database
   $result = $db-query($strSql);

   // Always check that $result is not an error
   if (DB::isError($result))
  die ($result-getMessage());

   while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
   {
  extract ($row);
  echo $feild_A . 'br /';
   }

OK, this is fine for a straight list!

But I need to create...

   tr
  tdrow_1/feild_A/td
  tdrow_1/feild_B/td
   /tr
   tr
  tdrow_2/feild_A/td
  tdrow_2/feild_B/td
   /tr
   ...

And using the method of WHILE() doesn't cut it.

Can some one enlighten me what syntax can I use to hit 2 rows at a time?

Thanks

Walter

-- 
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] [SPAM?] [PHP-DB] Re: That movie

2003-08-29 Thread jsWalter
This is the SoBig.F virus.

It hijacks a random email address form an infected persons phone book, uses
that address as the SENDER, and then proceeds to mail out copies of itself
to everyone in he infected persons phone book.

I've had my address hijacked twice now.

So, be warned, clean your system.

Be kind, the person you think sent it did not send it.

Walter

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



Re: [PHP-DB] another PHP Sql question...

2003-08-29 Thread jsWalter
 Boaz Yahav [EMAIL PROTECTED] wrote in message
 I'm not sure i understand the problem.
  a,c,e come from one query result and b,d,f from another?

No, they all come from the same table, but the same field name but from
different rows of the database.


 If it's all from the same query why not do :

 reult=mysql_query(.
 TABLE
 While($row = mysql_fetch_object($result)) {
 EchoTRTD$row-feild_A/TDTD$row-feild_B/TD/TR;
 }
 /TABLE

This method does not grap data from 2 rows at atime.

I examined my example and noticed I goofed, it should have read...

...

   tr
  tdrow_1/field_A/td
  tdrow_2/field_A/td
   /tr
   tr
  tdrow_3/field_A/td
  tdrow_4/field_A/td
   /tr

Same field, but diffeent rows.

Sorry for the confusion.

Walter

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



Re: [PHP-DB] Problem in executing linux command from PHP

2003-08-29 Thread Gnanavel
Quoting  [EMAIL PROTECTED]:

 From: Gnanavel [EMAIL PROTECTED]
 
 
  I have problem in executing  linux command
 
  $output=exec(ls -a);
  echo pre$output/pre;
 
  the above coding works, but
 
  $output=exec(cp file1 file2);
  echo pre$output/pre;
 
  does not works. can any one help me out of this problem
 
 Riddle me this... exec() returns the last line of output from the result
 of
 the command. What is the last line of output when you run cp file1
 file2
 from the command line?
 
 ---John Holmes...
 
 

When I was executing the cp command it doesn't return anything. 
But it returned the name of the last file when i executed the ls command

-
Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
Know more at http://mail.sify.com

Sify Power mail- a Premium Service from Sify Mail!
know more at http://mail.sify.com

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



RE: [PHP-DB] another PHP Sql question...

2003-08-29 Thread Jacob A. van Zanen
One question:

Do you mean that a  b are from the same column but are row 1  2 from
your query result.?

If so, you can possibly write a loop like so

Dump all your records in an array;
Start loop for as long you find records in array
{
Take the first record from your array and dump it into a
variable (var1);
Move the value from the variable var1 to another variable
(var2);
If both variables are set
{
Print the two variables with the html tags you want;
Unset both variables;
}
}
Add a handler to make sure you get the last records if it happens to be
an od number off records;


You'll have to do your own coding around this logic.


Good luck


Jack


-Original Message-
From: jsWalter [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2003 9:46 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] another PHP Sql question...


 Boaz Yahav [EMAIL PROTECTED] wrote in message
 I'm not sure i understand the problem.
  a,c,e come from one query result and b,d,f from another?

No, they all come from the same table, but the same field name but from
different rows of the database.


 If it's all from the same query why not do :

 reult=mysql_query(.
 TABLE
 While($row = mysql_fetch_object($result)) {
 EchoTRTD$row-feild_A/TDTD$row-feild_B/TD/TR;
 }
 /TABLE

This method does not grap data from 2 rows at atime.

I examined my example and noticed I goofed, it should have read...

...

   tr
  tdrow_1/field_A/td
  tdrow_2/field_A/td
   /tr
   tr
  tdrow_3/field_A/td
  tdrow_4/field_A/td
   /tr

Same field, but diffeent rows.

Sorry for the confusion.

Walter

-- 
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] another PHP Sql question...

2003-08-29 Thread Tiberiu Ardeleanu
 You can do:

 while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
 {
extract ($row);
echo $feild_A . 'nbsp';

$row = $result-fetchRow(DB_FETCHMODE_ASSOC);
extract ($row);
echo $feild_A . 'br /';
 }

Tiberiu

- Original Message - 
From: jsWalter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 8:14 AM
Subject: [PHP-DB] another PHP Sql question...


 I am querying a database just fine.

 Getting back what I expect, just fine.

 But now I've been thrown a wrench in the form of double row display.

 my client wants...

 a   b
 c   d
 e   f
...

 Well, I've reached the end on my PHP/SQL knowledge (which really isn't all
 that far!)

 Right now I'm doing (very much shortened)...

// Query the database
$result = $db-query($strSql);

// Always check that $result is not an error
if (DB::isError($result))
   die ($result-getMessage());

while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
{
   extract ($row);
   echo $feild_A . 'br /';
}

 OK, this is fine for a straight list!

 But I need to create...

tr
   tdrow_1/feild_A/td
   tdrow_1/feild_B/td
/tr
tr
   tdrow_2/feild_A/td
   tdrow_2/feild_B/td
/tr
...

 And using the method of WHILE() doesn't cut it.

 Can some one enlighten me what syntax can I use to hit 2 rows at a time?

 Thanks

 Walter

 -- 
 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] weird php error

2003-08-29 Thread Tiberiu Ardeleanu
Try:

 if ($_GET['login'] == 'forgot')


- Original Message - 
From: OpenSource [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 7:38 AM
Subject: [PHP-DB] weird php error


 Hi guys,
  
 This is weird to me..
 I got this script
 ---
 ?php
  
 if ($_GET[login] == 'forgot')
 {
 echo Sorry  I forgot my password;
 }
 else { echo you are good to go; }
  
 ?
 -
 when ran, it gives me this error
  
 
 Notice: Use of undefined constant login - assumed 'login' in
 G:\Inetpub\wwwroot\test\index.php on line 3
  
 Notice: Undefined index: login in G:\Inetpub\wwwroot\test\index.php on
 line 3 good to go
  
 What is this all about?
 The script look fine to me.
  
 Thanks in advance for your support
  
 

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



RE: [PHP-DB] Beta 2 of plPHP released.

2003-08-29 Thread Ford, Mike [LSS]
On 29 August 2003 05:27, Joshua D. Drake wrote:

 Hello,
 
   Beta 2 of plPHP has been released. This version contains many bug
 fixes. For example, if you write bad plphp code and try to
 execute it,
 the code will no longer crash PostgreSQL ;).

It would be nice if you told us what plPHP actually is as part of this message -- save 
those of us who have no interest in whatever it is having to make an unnecessary click 
through to your Web site.

Cheers!

Mike

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

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



RE: [PHP-DB] weird php error

2003-08-29 Thread Ford, Mike [LSS]
On 29 August 2003 06:39, OpenSource wrote:

 Hi guys,
 
 This is weird to me..
 I got this script
 --- ?php
 
 if ($_GET[login] == 'forgot')
 {
 echo Sorry  I forgot my password;  
 } else { echo you are good to go; }
 
  
 -
 when ran, it gives me this error
 
 
 Notice: Use of undefined constant login - assumed 'login' in
 G:\Inetpub\wwwroot\test\index.php on line 3

This is because you haven't quoted the array subscript -- PHP thinks you're
trying to refer to a constant called login, but on not finding that assumes
that you meant the string 'login' instead.  To suppress this notice, supply
the subscript correctly as a string:

if ($_GET['login'] == 'forgot')

 
 Notice: Undefined index: login in G:\Inetpub\wwwroot\test\index.php
 on line 3

This means that there was no login= parameter on the URL that called this
script.  If this is a permissible condition, you need to allow for it in
your code.  One way is simply to suppress the error message with the @
operator:

if (@$_GET['login'] == 'forgot')

Another is to do more explicit checking:

if (isset($_GET['login'])  $_GET['login'] == 'forgot')

Which you use is really down to personal preference.

Cheers!

Mike

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

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



[PHP-DB] SELECT Part of a Field

2003-08-29 Thread Shaun
Hi,

How can I SELECT a portion of a field in a table for example the first
character, or the second two characters etc?

Thanks for your help

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



Re: [PHP-DB] SELECT Part of a Field

2003-08-29 Thread Ignatius Reilly
SUBSTRING()

_
- Original Message - 
From: Shaun [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 11:57 AM
Subject: [PHP-DB] SELECT Part of a Field


 Hi,
 
 How can I SELECT a portion of a field in a table for example the first
 character, or the second two characters etc?
 
 Thanks for your help
 
 -- 
 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] SELECT Part of a Field

2003-08-29 Thread Jacob A. van Zanen

Depending on the database you are using
Substring()
Substr()
Functions do what you want


jack



-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2003 11:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SELECT Part of a Field


Hi,

How can I SELECT a portion of a field in a table for example the first
character, or the second two characters etc?

Thanks for your help

-- 
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] Beta 2 of plPHP released.

2003-08-29 Thread Martin Marques
El Vie 29 Ago 2003 06:15, Ford, Mike [LSS] escribió:
 On 29 August 2003 05:27, Joshua D. Drake wrote:
  Hello,
 
Beta 2 of plPHP has been released. This version contains many bug
  fixes. For example, if you write bad plphp code and try to
  execute it,
  the code will no longer crash PostgreSQL ;).

 It would be nice if you told us what plPHP actually is as part of this
 message -- save those of us who have no interest in whatever it is having
 to make an unnecessary click through to your Web site.

plPHP is the PHP Procedural Language for PostgreSQL.
So now I can write PHP code inside my database as Procedural Language, which 
takes a lot of load out of my aplication, and suites me great, because I 
don't have to write my PL code in perl or plsql

Saludos... :-)

-- 
 08:38:02 up 7 days, 28 min,  4 users,  load average: 0.94, 0.81, 0.55
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



[PHP-DB] delte stmt problem with joins

2003-08-29 Thread Merlin
Hi there,

I would like to delete a row inside a mysql table. To find out which 
rows are affected the system has to check another table.

Somehow I am doing this statement wrong and I cant find out why. Does 
anybody see the error?
Thanx for any help on that.

DELETE
FROM $table1 pi
RIGHT  JOIN $table2 AS p ON p.ID = pi.product_id
WHERE p.owner_id =  '15173'
Merlin

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


Re: [PHP-DB] delte stmt problem with joins

2003-08-29 Thread John W. Holmes
Merlin wrote:

I would like to delete a row inside a mysql table. To find out which 
rows are affected the system has to check another table.

Somehow I am doing this statement wrong and I cant find out why. Does 
anybody see the error?
Thanx for any help on that.

DELETE
FROM $table1 pi
RIGHT  JOIN $table2 AS p ON p.ID = pi.product_id
WHERE p.owner_id =  '15173'
1. You're using MySQL 4, right?

2. Echo your query to the screen when you're having trouble. Ensure you 
really have a value for $table1, $table2, etc.

3. Try this format:

DELETE $table1 FROM $table1 pi, $table2 p WHERE p.ID = pi.product_id AND 
p.owner_id = '15173'

4. If you're still having trouble, what does mysql_error() say after you 
execute the query?

--
---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] weird php error

2003-08-29 Thread Kieu D. Trang
try

if (isset($_GET['login']) AND $_GET['login'] == 'forgot')
KD

On Fri, 29 Aug 2003, Tiberiu Ardeleanu wrote:

 Try:

  if ($_GET['login'] == 'forgot')


 - Original Message -
 From: OpenSource [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, August 29, 2003 7:38 AM
 Subject: [PHP-DB] weird php error


  Hi guys,
 
  This is weird to me..
  I got this script
  ---
  ?php
 
  if ($_GET[login] == 'forgot')
  {
  echo Sorry  I forgot my password;
  }
  else { echo you are good to go; }
 
  ?
  -
  when ran, it gives me this error
 
  
  Notice: Use of undefined constant login - assumed 'login' in
  G:\Inetpub\wwwroot\test\index.php on line 3
 
  Notice: Undefined index: login in G:\Inetpub\wwwroot\test\index.php on
  line 3 good to go
 
  What is this all about?
  The script look fine to me.
 
  Thanks in advance for your support
 
 

 --
 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] delte stmt problem with joins

2003-08-29 Thread Merlin
Hi John,

I am using MySQL 3.x
My guess is that it does not support a query like this. If so, I am sure 
that there is a workaround I just dont know about. The values $tablex 
are present.

This is the error msg:

 Error:  1064 You have an error in your SQL syntax near 'pi INNER JOIN 
table2 AS p ON p.ID = pi.product_id WHERE p.ow' at line 3

Merlin



John W. Holmes wrote:

Merlin wrote:

I would like to delete a row inside a mysql table. To find out which 
rows are affected the system has to check another table.

Somehow I am doing this statement wrong and I cant find out why. Does 
anybody see the error?
Thanx for any help on that.

DELETE
FROM $table1 pi
RIGHT  JOIN $table2 AS p ON p.ID = pi.product_id
WHERE p.owner_id =  '15173'


1. You're using MySQL 4, right?

2. Echo your query to the screen when you're having trouble. Ensure you 
really have a value for $table1, $table2, etc.

3. Try this format:

DELETE $table1 FROM $table1 pi, $table2 p WHERE p.ID = pi.product_id AND 
p.owner_id = '15173'

4. If you're still having trouble, what does mysql_error() say after you 
execute the query?

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


Re: [PHP-DB] delte stmt problem with joins

2003-08-29 Thread John W. Holmes
Merlin wrote:

Hi John,

I am using MySQL 3.x
My guess is that it does not support a query like this. If so, I am sure 
that there is a workaround I just dont know about. The values $tablex 
are present.

This is the error msg:

 Error:  1064 You have an error in your SQL syntax near 'pi INNER JOIN 
table2 AS p ON p.ID = pi.product_id WHERE p.ow' at line 3


There is no work around. You must first select the numbers you want to 
match, store them in PHP, then issue a delete query using those numbers 
from php.

--
---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


[PHP-DB] another PHP Sql question...

2003-08-29 Thread Kit DeKat
At 09:33 AM 8/29/2003, you wrote:
 You can do:
while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
 {
extract ($row);
echo $feild_A . 'nbsp';
$row = $result-fetchRow(DB_FETCHMODE_ASSOC);
extract ($row);
echo $feild_A . 'br /';
 }
close, but doesn't handle odd row counts...

 while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
 {
extract ($row);
echo $feild_A;
if( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) )
{
extract ($row);
echo 'nbsp' . $feild_A . 'br /';
}
else
{
echo 'br /';
/* optionally, add a 'last' here to skip extra db-call */
}
 }
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] delte stmt problem with joins

2003-08-29 Thread Hutchins, Richard
   Error:  1064 You have an error in your SQL syntax near 'pi 
 INNER JOIN 
  table2 AS p ON p.ID = pi.product_id WHERE p.ow' at line 3

pi() is a mysql function that returns the value of pi. Could the pi in your
query be causing some confusion? It seems that MySql may be expecting pi()
not pi.productID.

Just a guess since it's a syntax error.

 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 29, 2003 9:55 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] delte stmt problem with joins
 
 
 Merlin wrote:
 
  Hi John,
  
  I am using MySQL 3.x
  My guess is that it does not support a query like this. If 
 so, I am sure 
  that there is a workaround I just dont know about. The 
 values $tablex 
  are present.
  
  This is the error msg:
  
   Error:  1064 You have an error in your SQL syntax near 'pi 
 INNER JOIN 
  table2 AS p ON p.ID = pi.product_id WHERE p.ow' at line 3
 
 
 There is no work around. You must first select the numbers 
 you want to 
 match, store them in PHP, then issue a delete query using 
 those numbers 
 from php.
 
 -- 
 ---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
 

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



Re: [PHP-DB] another PHP Sql question...

2003-08-29 Thread Kit DeKat
At 09:33 AM 8/29/2003, you wrote:
  You can do:
 while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
  {
 extract ($row);
 echo $feild_A . 'nbsp';

 $row = $result-fetchRow(DB_FETCHMODE_ASSOC);
 extract ($row);
 echo $feild_A . 'br /';
  }
close, but doesn't handle odd row counts...

  while ($row = $result-fetchRow(DB_FETCHMODE_ASSOC))
  {
 extract ($row);
 echo $feild_A;
 if( $row = $result-fetchRow(DB_FETCHMODE_ASSOC) )
 {
 extract ($row);
 echo 'nbsp' . $feild_A . 'br /';
 }
 else
 {
 echo 'br /';
 /* optionally, add a 'last' here to skip extra db-call */
 }
  }
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Failure Notices When Posting to List

2003-08-29 Thread Hutchins, Richard
Is anybody else getting returned mail notices from the qmail-send program at
pb1.pair.com? I seem to get one with each post I send to the list and I
don't know what's happening with my posts.

Not that they're pure gold or anything, but could somebody just confirm
that my posts are getting through to others on this list?

Thanks.
Rich

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



Re: [PHP-DB] Failure Notices When Posting to List

2003-08-29 Thread Martin Marques
El Vie 29 Ago 2003 11:51, Hutchins, Richard escribió:
 Is anybody else getting returned mail notices from the qmail-send program
 at pb1.pair.com? I seem to get one with each post I send to the list and I
 don't know what's happening with my posts.

 Not that they're pure gold or anything, but could somebody just confirm
 that my posts are getting through to others on this list?

Yes, I already sent a mail to the postmaster, but without any answer. Hope 
they fix it.

Any way, mails get to the list, so I really don't understand it.

-- 
 11:52:01 up 7 days,  3:42,  5 users,  load average: 0.82, 0.86, 0.61
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



[PHP-DB] MySQL: CREATE TABLE, BLOB, UNIQUE, INDEX etc

2003-08-29 Thread Dillon, John
My code:

$query=
CREATE TABLE IF NOT EXISTS temp3 UNIQUE(CON175) 
IGNORE SELECT DISTINCT CONCAT($tbl2.this,$tbl2.that) AS CON175 FROM
$tbl2 
WHERE $tbl2.this='$rcc'
; 

gives error:

Query failed: BLOB column 'CON175' used in key specification without a key
length.

Manual suggests to give a BLOB a length:
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));

...but how do you work this into the above query?
CREATE TABLE IF NOT EXISTS temp3 (UNIQUE(CON175) BLOB,
INDEX(CON175)(50))...

..does not work, I suppose because CON175 has not been created yet?

CON175 is BLOB by default resulting from this part of the query: IGNORE
SELECT DISTINCT CONCAT($tbl2.this,$tbl2.that)... this and that are varchar
types.  How do I set this as varchar instead:

UNIQUE(CON175) VARCHAR(50)

does not work.

http://www.mysql.com/doc/en/CREATE_TABLE.html - lacks examples!

John























   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html

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



RE: [PHP-DB] Failure Notices When Posting to List - CLOSED

2003-08-29 Thread Hutchins, Richard
Fellow PHP-DB listers:

Thank you to those of you who replied to let me know that I am not the only
one experiencing this problem. For everybody else's edification, some of the
other members of this list have stated that they have notified the
postmaster of the problem. It's really just an annoyance, but, hopefully,
it'll be fixed soon.

Peace,
Rich

 -Original Message-
 From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 29, 2003 10:52 AM
 To: PHP-DB (E-mail)
 Subject: [PHP-DB] Failure Notices When Posting to List
 
 
 Is anybody else getting returned mail notices from the 
 qmail-send program at
 pb1.pair.com? I seem to get one with each post I send to the 
 list and I
 don't know what's happening with my posts.
 
 Not that they're pure gold or anything, but could somebody 
 just confirm
 that my posts are getting through to others on this list?
 
 Thanks.
 Rich
 
 -- 
 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] MySQL: CREATE TABLE, BLOB, UNIQUE, INDEX etc

2003-08-29 Thread Ignatius Reilly
You should be very wary of the CREATE TABLE ... SELECT statement.
From experience, the types created are not always conform to intuition -
I've had my share of nasty surprises

Much safer to do a CREATE TABLE statement defining the column types, then do
an INSERT INTO ... SELECT

Ignatius
_
- Original Message -
From: Dillon, John [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Friday, August 29, 2003 5:06 PM
Subject: [PHP-DB] MySQL: CREATE TABLE, BLOB, UNIQUE, INDEX etc


My code:

$query=
CREATE TABLE IF NOT EXISTS temp3 UNIQUE(CON175)
IGNORE SELECT DISTINCT CONCAT($tbl2.this,$tbl2.that) AS CON175 FROM
$tbl2
WHERE $tbl2.this='$rcc'
;

gives error:

Query failed: BLOB column 'CON175' used in key specification without a key
length.

Manual suggests to give a BLOB a length:
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));

...but how do you work this into the above query?
CREATE TABLE IF NOT EXISTS temp3 (UNIQUE(CON175) BLOB,
INDEX(CON175)(50))...

..does not work, I suppose because CON175 has not been created yet?

CON175 is BLOB by default resulting from this part of the query: IGNORE
SELECT DISTINCT CONCAT($tbl2.this,$tbl2.that)... this and that are varchar
types.  How do I set this as varchar instead:

UNIQUE(CON175) VARCHAR(50)

does not work.

http://www.mysql.com/doc/en/CREATE_TABLE.html - lacks examples!

John























http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any,
are confidential. If you are not the named recipient please notify the
sender and immediately delete it. You may not disseminate, distribute, or
forward this e-mail message or disclose its contents to anybody else.
Copyright and any other intellectual property rights in its contents are the
sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of e-mail
transmission.  If verification is required please request a hard-copy
version.
 Although we routinely screen for viruses, addressees should check this
e-mail and any attachments for viruses. We make no representation or
warranty as to the absence of viruses in this e-mail or any attachments.
Please note that to ensure regulatory compliance and for the protection of
our customers and business, we may monitor and read e-mails sent to and from
our server(s).

For further important information, please read the  Important Legal
Information and Legal Statement at
http://www.cantor.com/legal_information.html

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

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



[PHP-DB] Upload multiple files?

2003-08-29 Thread Chris Payne
Hi there everyone,

I have created a newsletter system where you can do lots of nice things, one of the 
things is to be able to upload your images for the newsletter via the interface, 
unfortunately you have to do them 1 at a time.  Is it possible to be able to select 
multiple images in 1 go?

The image info is stored in a DB and the images themselves are on the server, this way 
I can do lots of nice things to manage the images that have been uploaded without 
having to access the filesystem too much (I love PHP and MySQL, makes it so easy).

Thanks everyone.

Chris

RE: [PHP-DB] Upload multiple files?

2003-08-29 Thread Aaron Wolski
Well...

Having never done this I would assume it's the same with and form field
you want to use as an array (multiple selections).

Create a few different fileselect fields all with the same name but
adding in [] to make it an array.

Then just loop through the array.. copying the file to the server and
the filename info to the DB.

Rather simplistic I know but it's a solution.

HTH

Aaron

 -Original Message-
 From: Chris Payne [mailto:[EMAIL PROTECTED]
 Sent: August 29, 2003 5:38 PM
 To: php
 Subject: [PHP-DB] Upload multiple files?
 
 Hi there everyone,
 
 I have created a newsletter system where you can do lots of nice
things,
 one of the things is to be able to upload your images for the
newsletter
 via the interface, unfortunately you have to do them 1 at a time.  Is
it
 possible to be able to select multiple images in 1 go?
 
 The image info is stored in a DB and the images themselves are on the
 server, this way I can do lots of nice things to manage the images
that
 have been uploaded without having to access the filesystem too much (I
 love PHP and MySQL, makes it so easy).
 
 Thanks everyone.
 
 Chris

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



Re: [PHP-DB] Upload multiple files?

2003-08-29 Thread Chris Payne
Hi there,

U you know what they say, keep it simple and you're probably right you
know, I was thinking it would be more complex but i'll have a play with that
idea (Isn't it amazing how sometime we try to make things harder for
ourselves than they need be?).

Thanks for pointing that solution out, it SHOULD work :-)

Chris

 Well...

 Having never done this I would assume it's the same with and form field
 you want to use as an array (multiple selections).

 Create a few different fileselect fields all with the same name but
 adding in [] to make it an array.

 Then just loop through the array.. copying the file to the server and
 the filename info to the DB.

 Rather simplistic I know but it's a solution.

 HTH

 Aaron

  -Original Message-
  From: Chris Payne [mailto:[EMAIL PROTECTED]
  Sent: August 29, 2003 5:38 PM
  To: php
  Subject: [PHP-DB] Upload multiple files?
 
  Hi there everyone,
 
  I have created a newsletter system where you can do lots of nice
 things,
  one of the things is to be able to upload your images for the
 newsletter
  via the interface, unfortunately you have to do them 1 at a time.  Is
 it
  possible to be able to select multiple images in 1 go?
 
  The image info is stored in a DB and the images themselves are on the
  server, this way I can do lots of nice things to manage the images
 that
  have been uploaded without having to access the filesystem too much (I
  love PHP and MySQL, makes it so easy).
 
  Thanks everyone.
 
  Chris

 -- 
 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] Upload multiple files?

2003-08-29 Thread Aaron Wolski
The other option is...

You create a pop-up menu system.

That have the file form field to select from a location. When you upload
the image it populates a HTML display table so you can see it and also
allows you to select another image. 

When you are done.. you close the pop-up menu and that's that!

You got options. Just a matter of how much time you wanna invest ;)

Aaron

 -Original Message-
 From: Chris Payne [mailto:[EMAIL PROTECTED]
 Sent: August 29, 2003 5:45 PM
 To: php
 Subject: Re: [PHP-DB] Upload multiple files?
 
 Hi there,
 
 U you know what they say, keep it simple and you're probably right
you
 know, I was thinking it would be more complex but i'll have a play
with
 that
 idea (Isn't it amazing how sometime we try to make things harder for
 ourselves than they need be?).
 
 Thanks for pointing that solution out, it SHOULD work :-)
 
 Chris
 
  Well...
 
  Having never done this I would assume it's the same with and form
field
  you want to use as an array (multiple selections).
 
  Create a few different fileselect fields all with the same name but
  adding in [] to make it an array.
 
  Then just loop through the array.. copying the file to the server
and
  the filename info to the DB.
 
  Rather simplistic I know but it's a solution.
 
  HTH
 
  Aaron
 
   -Original Message-
   From: Chris Payne [mailto:[EMAIL PROTECTED]
   Sent: August 29, 2003 5:38 PM
   To: php
   Subject: [PHP-DB] Upload multiple files?
  
   Hi there everyone,
  
   I have created a newsletter system where you can do lots of nice
  things,
   one of the things is to be able to upload your images for the
  newsletter
   via the interface, unfortunately you have to do them 1 at a time.
Is
  it
   possible to be able to select multiple images in 1 go?
  
   The image info is stored in a DB and the images themselves are on
the
   server, this way I can do lots of nice things to manage the images
  that
   have been uploaded without having to access the filesystem too
much (I
   love PHP and MySQL, makes it so easy).
  
   Thanks everyone.
  
   Chris
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DB] Upload multiple files?

2003-08-29 Thread colbey

Very simple...

Call you files being uplaoded file1, file2, fileX in the HTML form..

[html]
form method=post action=uploadprocess.php enctype=multipart/form-data
input type=file name=file1 size=20
input type=file name=file2 size=20
input type=file name=file3 size=20
input type=submit name=submit value=submit
/form
[/html]

Then process with code like this:

[code]
$STARTFILE = 1;
$ONFILE = file . $STARTFILE;

while (isset($HTTP_POST_FILES[$ONFILE])) {

  // Try!
  $SrcPathFile = $HTTP_POST_FILES[$ONFILE][tmp_name];
  $SrcFileType = $HTTP_POST_FILES[$ONFILE][type];
  $DstFileName = $HTTP_POST_FILES[$ONFILE][name];

  // File Processing
  if (file_exists($SrcPathFile)) {

// handle it
  }

  $STARTFILE ++;
  $ONFILE = file . $STARTFILE;
}
[/code]

You may want to update the $HTTP_POST_FILES - $_FILES depending on PHP
version, etc...

Code from: http://php.dreamwerx.net/forums/viewtopic.php?t=6

good luck..



On Fri, 29 Aug 2003, Chris Payne wrote:

 Hi there everyone,

 I have created a newsletter system where you can do lots of nice things, one of the 
 things is to be able to upload your images for the newsletter via the interface, 
 unfortunately you have to do them 1 at a time.  Is it possible to be able to select 
 multiple images in 1 go?

 The image info is stored in a DB and the images themselves are on the server, this 
 way I can do lots of nice things to manage the images that have been uploaded 
 without having to access the filesystem too much (I love PHP and MySQL, makes it so 
 easy).

 Thanks everyone.

 Chris

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



[PHP-DB] Re: db connection php mssql win2k

2003-08-29 Thread jsWalter
This is what I use...


// Pull in DB PEAR Collection
require_once 'DB.php';

// What kind of database server are we connecting too?
$db_type = 'mysql';

// local connectivity data
$db_host = 'localhost';
$db_user = 'dbUsername
$db_pass = 'dbUserPW';
$db_name = 'dbName';

// Data Source Name: This is the universal connection string
$dsn = $db_type://$db_host/$db_name;

// DB::connect will return a PEAR DB object on success
// or an PEAR DB Error object on error
$db = DB::connect($dsn);

// With DB::isError you can differentiate between an error or
// a valid connection.
if (DB::isError($db))
   die ($db-getMessage());

// Build Query
$strSql  = 'SELECT * ';
$strSql .= ' FROM tableName ';
$strSql .= ' WHERE feild_1 = x ';

// Query the db
$result = $db-query($strSql);

// Always check that $result is not an error
if (DB::isError($result))
   die ($result-getMessage());

// close conection
$db-disconnect();

// Now you have the returned results in $results.
// Do as you will

Walter

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