RE: [PHP] receiving ndr for each email sent to list

2004-03-22 Thread Chris W. Parker
ok so does anyone know why this is happening (no theories please. unless
it's correct. in which case it's ok. :)? is there something a list
moderator can do about it?



chris.

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



Re: [PHP] Any Ideas?

2004-03-22 Thread Robert Cummings
On Mon, 2004-03-22 at 19:25, John W. Holmes wrote:
> Robert Cummings wrote:
> 
> > On Mon, 2004-03-22 at 18:51, Matthew Oatham wrote:
> > 
> >>Hi,
> >>
> >>are there any functions that retrieve the last primary key created in
> >>the MySQL table?
> > 
> > 
> > http://www.php.net/manual/en/function.mysql-insert-id.php
> 
> If you read the whole question, though, the poster wanted to use the ID 
> in the same query, just in another column. mysql_insert_id() or 
> LAST_INSERT_ID() wouldn't help in this case.

Actually I did read the entire question. The poster includes mention of
using insert, then update, or possibly locking the table. This logically
implies that he does not necessarily care whether the construction of
the ID occurs in the original query or not.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] PHP installation problem in FreeBSD OS.

2004-03-22 Thread Naveen Glore
Hello All,
I am not sure if this is the right place to post this problem. I tried with FreeBSD 
mailing list but could not get much help. 
 
I am having hard time in installing php4  using portupgrade in FreeBSD.

First i have updated the port directory using cvsup. I am doing fresh installation of 
php so i gave the following command.
 
portupgrade -NPRri mod_php4.
 
I noticed mysql3.23.51 got updated to mysql3.23.58_2. All the other dependencies also 
had no problem in updating. However the php installation was not successful. At the 
end of installation i got the following errors.
 
Command failed [exit code 1] /usr/bin/script -qa /tmp/portupgrade23698.1 make
 
mysql-client-3.23.58 is already installed or may be older version blah blah blah... 
you can uninstall and reinstall mysql blah blah blah ...to install correctly. If you 
really want to override without deleting use FORCE_PICG_REGISTER blah blah
 
I also tried to install php after doing "make clean" in 
/usr/ports/databases/mysql323-client but it did not help me.
Any pointer would be very helpful. Thanks in advace.
 
Thanks,
Naveen.

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

[PHP] Re: Passing by conditional IF statement...why?

2004-03-22 Thread Ligaya Turmelle
I think it is because the query ran successfully and returns an empty set.
So the pointer is still good.

Respectfully,
Ligaya Turmelle


"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I have this simple code in my php script:
>
> * * * * *
> $res = mysql_query("SELECT product_id, now()-1 FROM ".$tc."_prods where
> cno=$cno AND product_id='$product_id' LIMIT 1");
>
> if($res)
>  {
>  $r = mysql_fetch_row($res);
>  $product_id2   = $r[0];
>  $th_pres= $r[1];
> echo "debug echo";
>  }else {echo "No results, sorry";}
> * * * * *
>
> its working great when the data actually exists but when there are no
> matches it still executes the "if($res)" part instead of
> displaying "No results, sorry".
> Why is that? or am I using the syntax wrong?
>
> Thanks,
> -Ryan

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



Re: [PHP] Any Ideas?

2004-03-22 Thread John W. Holmes
Matthew Oatham wrote:

Bit rough at the moment but I have come up with the following - it doesn't
rename the file using the new ID yet but I am more concerned about my method
for creating the new ID - can anyone see any potential problems such as
database problems, i.e duplicate keys, bad coding practices etc... cheers
matt
if(!empty($_FILES["cr"])) {
$uploaddir = "cr/"; // set this to wherever
//copy the file to some permanent location
if (move_uploaded_file($_FILES["cr"]["tmp_name"], $uploaddir .
$_FILES["cr"]["name"])) {
echo("file uploaded\n");
echo(generateCrId(insertChangeRequest()));
} else {
echo ("error!");
}
}
function insertChangeRequest() {

$sql = mysql_query("INSERT INTO dis_status(status, description)
VALUES('status1', 'status1 description')") or die (mysql_error());
return mysql_insert_id();
}
function generateCrId($key) {

$crId = sprintf("CR-%03d", $key);

return $crId;
}
Looks fine. Just realize that you don't have to insert $crId into the 
database as you can just "recreate" it when you need to know the file 
name. You just retrieve the "id" and add the "CR-" to it.

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

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

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


Re: [PHP] Re: Passing by conditional IF statement...why?

2004-03-22 Thread Daniel Guerrier
if(mysql_num_rows($res))

returns count of rows returned.
if it 0 is false so it shouldn't execute the
conditional code
--- Ligaya Turmelle <[EMAIL PROTECTED]> wrote:
> I think it is because the query ran successfully and
> returns an empty set.
> So the pointer is still good.
> 
> Respectfully,
> Ligaya Turmelle
> 
> 
> "Ryan A" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> > Hi,
> > I have this simple code in my php script:
> >
> > * * * * *
> > $res = mysql_query("SELECT product_id, now()-1
> FROM ".$tc."_prods where
> > cno=$cno AND product_id='$product_id' LIMIT 1");
> >
> > if($res)
> >  {
> >  $r = mysql_fetch_row($res);
> >  $product_id2   = $r[0];
> >  $th_pres= $r[1];
> > echo "debug echo";
> >  }else {echo "No results, sorry";}
> > * * * * *
> >
> > its working great when the data actually exists
> but when there are no
> > matches it still executes the "if($res)" part
> instead of
> > displaying "No results, sorry".
> > Why is that? or am I using the syntax wrong?
> >
> > Thanks,
> > -Ryan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



[PHP] PHP5 Release

2004-03-22 Thread daniel
Hi there i noticed RC1 is released, it states not for critical use, does
that mean for development purposes still ?

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



Re: [PHP] Re: Passing by conditional IF statement...why?

2004-03-22 Thread Ryan A
> "Ryan A" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> > Hi,
> > I have this simple code in my php script:
> >
> > * * * * *
> > $res = mysql_query("SELECT product_id, now()-1
> FROM ".$tc."_prods where
> > cno=$cno AND product_id='$product_id' LIMIT 1");
> >
> > if($res)
> >  {
> >  $r = mysql_fetch_row($res);
> >  $product_id2   = $r[0];
> >  $th_pres= $r[1];
> > echo "debug echo";
> >  }else {echo "No results, sorry";}
> > * * * * *
> >
> > its working great when the data actually exists
> but when there are no
> > matches it still executes the "if($res)" part
> instead of
> > displaying "No results, sorry".
> > Why is that? or am I using the syntax wrong?
> >
> > Thanks,
> > -Ryan

Thanks guys,
I'm now using:

if(($r = mysql_fetch_row($res)) >=1)

and its working fine, if the above approach has some problems, feel free to
write and tell me.

Cheers,
-Ryan

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



Re: [PHP] PHP installation problem in FreeBSD OS.

2004-03-22 Thread Filip de Waard
On Mar 22, 2004, at 7:59 PM, Naveen Glore wrote:

Hello All,
I am not sure if this is the right place to post this problem. I tried 
with FreeBSD mailing list but could not get much help.
No, it isn't. There is a specific installation list 
([EMAIL PROTECTED]).
I am having hard time in installing php4  using portupgrade in FreeBSD.
Try installing from source. There are dozens of tutorials on the net 
which will help you.

Regards,

Filip de Waar

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


Re: [PHP] Re: Passing by conditional IF statement...why?

2004-03-22 Thread John W. Holmes
Ryan A wrote:

if(($r = mysql_fetch_row($res)) >=1)
if($r = mysql_fetch_row($res))

will work fine if you only have one row being returned. If you have more 
than one that you need to loop through, then:

if($r = mysql_fetch_row($res))
{
  do
  {
  }while($r = mysql_fetch_row($res));
}
Now you have the added efficiency of not having to call mysql_num_rows() 
(if you don't need that value).

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

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

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


[PHP] Image Storage

2004-03-22 Thread Matt Palermo
I am creating a system to allow users to upload images to the site.  Would
it be better to store the images in a MySQL table, or having it save the
images to a directory on the server?  Anyone have any suggestions on this?
Pros? Cons?

Thanks,

Matt
http://sweetphp.com/

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



Re: [PHP] Image Storage

2004-03-22 Thread Michal Migurski
>I am creating a system to allow users to upload images to the site.
>Would it be better to store the images in a MySQL table, or having it
>save the images to a directory on the server?  Anyone have any
>suggestions on this? Pros? Cons?

Depends on the details of your situation - I've generally preferred to
store image in the filesystem. A few hosts I've used have administrative
limits on the size of a BLOB field, so storing images in the filesystem
was mandatory.

If those images are stored within the docroot, you can also just refer to
them by URI and let Apache handle all the appropriate headers and such, or
if you're strapped for CPU you can even use a completely different
webserver (thttpd, apache without PHP, etc.) to serve them.

If they're stored in the database or outside the docroot, you can control
access to them more easily. Keeping them in the database also means that
you don't have to worry about various filesystem considerations, like
keeping a world-writeable directory or potential undesired access from
others users in a shared hosting environment.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Re: Passing by conditional IF statement...why?

2004-03-22 Thread Ryan A
Hey John,
Yep, this is just for one row as I need to know which file before I force a
download.
This is for people selling ebooks, MP3s etc

I usually use a while loop if I need multiple rows returned.

Cheers,
-Ryan

On 3/23/2004 3:07:14 AM, [EMAIL PROTECTED] wrote:
> Ryan A wrote:
>
> > if(($r = mysql_fetch_row($res)) >=1)
>
> if($r = mysql_fetch_row($res))
>
> will work fine if you only have one row being returned. If you have more
> than one that you need to loop through, then:
>
> if($r = mysql_fetch_row($res))
> {
> do
> {
>
> }while($r = mysql_fetch_row($res));
> }
>
> Now you have the added efficiency of not having to call mysql_num_rows()
> (if you don't need that value).
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals - www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



RE: [PHP] SQL Injection check (mysql)

2004-03-22 Thread trlists
On 23 Mar 2004 Michael Rasmussen wrote:

> The idea is exactly not to do any queries dynamically generated based on
> user input! In the rare cases where this is needed you should not
> allow any unparsed input. 

There are some applications for which queries based on typed user input 
are rare.  But there are others for which those queries are the basis 
of the whole application!  Almost any kind of site where users are 
creating accounts and other data records (or their equivalents) will be 
like this, and that's a very common kind of web application.

I agree that in these cases the input should be validated, I think that 
was the original topic of the thread.  But I don't think you can call 
this "rare" as a general rule.

--
Tom

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



Re: [PHP] RE:[PHP] sessions...how to use not clear?

2004-03-22 Thread trlists
On 22 Mar 2004 Andy B wrote:

> so the theory is: if i require that the session be named after the persons
> login name there is probably 1 out of 2 million chances that it will mess up
> the names and get confused (specially if there are only a few users
> allowed)...

If the login name is unique and you don't allow multiple simultaneous 
logins then the chanve of a mixup is exactly zero.

If you are talking about session IDs, I believe they are 128 bits which 
translates to a chance of duplication of 1 in 
340,282,366,920,938,463,463,374,607,431,768,211,456 [the result from 
bcpow(2, 128, 0)].  Should be good enough :-).

--
Tom

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



Re: [PHP] PHP5 Release

2004-03-22 Thread Yann Larrivee
RC's should never be used in production area, you can use them to teste
the new feautres and your software.


Yann

On Mon, 2004-03-22 at 20:45, [EMAIL PROTECTED] wrote:
> Hi there i noticed RC1 is released, it states not for critical use, does
> that mean for development purposes still ?

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



[PHP] an if statement

2004-03-22 Thread Andy B
was just wondering if the statement:
if(!$name || !$comments){
/*whatever here*/ }

would be interpreted as : if either $name or $comments doesn't exist then

or how would the if statement be?? i need to check if the $name and $comments are 
empty/null because both $name and $comments are required to continue in the site (to 
make a post)..



Re: [PHP] an if statement

2004-03-22 Thread John W. Holmes
Andy B wrote:
was just wondering if the statement:
if(!$name || !$comments){
/*whatever here*/ }
would be interpreted as : if either $name or $comments doesn't exist then

or how would the if statement be?? i need to check if the $name and $comments are empty/null because both $name and $comments are required to continue in the site (to make a post)..


although that'll generally "work", why not use

if(empty($name) || empty($comments))
{ dosomething(); }
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

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

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


[PHP] Unable connect to ORACLE

2004-03-22 Thread Timotius
Hi all, I'm newbie in PHP. 

I found message when I connect to ORACLE. Here you are :

Warning: odbc_connect(): SQL error: 
[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve 
service name , SQL state 08004 in SQLConnect in c:\program 
files\apache group\apache\htdocs\connectdb.php on line 2

and here is my PHP script:


$query = "SELECT cust_vendor_id, cv_name FROM 
dbsoe.cust_vendor where
cv_name like 'ANU%'";

?>

But when I connect using another Database Explorer through 
the same ODBC, it works. user id and password are correct. 
I've checked it. Can you tell me why ? 

thanks a million. 
Timotius
===
Netkuis Instan untuk Divre 3 - SD,SMP,SMA berhadiah asuransi pendidikan puluhan juta rupiah... periode I dimulai 1 April 2004
===

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


[PHP] Ticketing system

2004-03-22 Thread daniel
Hi there, ok i am asking now, but be assured that I have googled already. I
am looking for a good customisable ticketing system in PHP, i had a look at
request tracker, but it doesnt look customisable and its in Perl.

I am trying to find if there are solutions to what we want before i go and
build it from scratch, let me know thanks.

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



[PHP] re: an if statement

2004-03-22 Thread Andy B
> although that'll generally "work", why not use
>
> if(empty($name) || empty($comments))
> { dosomething(); }
>
> -- 
> ---John Holmes...


because for some odd reason on any of the versions of php i am writing for
(4.0.6-4.1.3) it always fails

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



[PHP] mysql_connect error

2004-03-22 Thread T UmaShankari

Hello,

 Here i am facing one problem. i have installed the following in my pc in 
linux platform. i am getting this error when try to execute file. Can any 
one tell me why this error due to ?


Version :
mysql-3.32.41-1
php-4.2.2-17
apache httpd-2.0.40-21

Error :
Call to undefined function mysql_connect() on line no 6.

Regards,
Uma

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



[PHP] Re: an if statement

2004-03-22 Thread Evgeny Pedya
Hello, Andy!
You wrote  on Mon, 22 Mar 2004 22:59:02 -0500:

 AB> was just wondering if the statement:
 AB> if(!$name || !$comments){
 AB> /*whatever here*/ }

 AB> would be interpreted as : if either $name or $comments doesn't exist
 AB> then

 AB> or how would the if statement be?? i need to check if the $name and
 AB> $comments are empty/null because both $name and $comments are
 AB> required to continue in the site (to make a post)..
Maybe?..

if (!isset($name) || !isset($comments))
{
 /*whatever here*/
}

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



RE: [PHP] mysql_connect error

2004-03-22 Thread php-general
T,

You also need to load the php_mysql rpm (Assuming you loaded via rpm)

Till We Meet Again...

Clifford W. Hansen
Operations Support Developer
Aspivia (Pty) Ltd.

+27 (0) 11 259-1150 (Switchboard)
+27 (0) 11 259-1019 (Fax)
+27 (0) 83 761-0240 (Mobile)
[EMAIL PROTECTED] (EMail)
http://chansen.aspivia.com (Web)

Registered Linux user number 343424 on http://counter.li.org/

"We have seen strange things today!" Luke 5:26

This message contains information intended for the perusal, and/or use (if
so stated), of the stated addressee(s) only. The information is confidential
and privileged. If you are not an intended recipient, do not peruse, use,
disseminate, distribute, copy or in any manner rely upon the information
contained in this message (directly or indirectly). The sender and/or the
entity represented by the sender shall not be held accountable in the event
that this prohibition is disregarded.

If you receive this message in error, notify the sender immediately by
e-mail, fax or telephone and return and/or destroy the original message.

The views or representations contained in this message, whether express or
implied, are those of the sender only, unless that sender expressly states
them to be the views or representations of an entity or person, who shall be
named by the sender and who the sender shall state to represent. No
liability shall otherwise attach to any other entity or person.

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



[PHP] Constants

2004-03-22 Thread Jakes
The bug server looks like its down, so I will just post the bug here, and
hopefully someone
will spot it

PHP version: 5RC1

displayFoo();
?>

The results should display "hello world", but it prints out MY_FOO.

Thanks

Jakes

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



<    1   2