Re: [PHP] MySQL Query Help

2010-11-21 Thread PW
SELECT * FROM products p LEFT JOIN criteria_values cv ON p.key=cv.key LEFT JOIN 
criteria c ON cv.key=c.key WHERE c.value IS NOT NULL

Hard to answer without more detail, but I am guessing the answer will be 
something like the above. Your question makes it hard to understand whether c 
or cv is joined to p. So swap em around if I misunderstood. 

iPhone 4. It rocks!

On Nov 21, 2010, at 1:37 AM, Simcha Younger sim...@syounger.com wrote:

 On Sat, 20 Nov 2010 13:54:29 -0700
 Ben Miller biprel...@gmail.com wrote:
 
 Hi,
 
 I'm building a website for a client in which I need to compare their
 products, side-by-side, but only include criteria for which all selected
 products have a value for that criteria.
 
 In my database (MySQL), I have a tables named products,criteria and
 criteria_values
 
 If I have something like
 
 $selected_product = array(1=Product 1,2=Product 2...)  //  All
 products selected for comparison by the user
 
 I need to get only rows from criteria where there is a row in
 criteria_values matching criteria.criteria_id for each $selected_product
 - in other words, if any of the $selected_product does not have a row in
 criteria_values that matches criteria.criteria_id, that criteria would
 not be returned.  I hope that makes sense.
 
 It would be a lot easier to think about this if you could provide the table 
 structure or create table statements.
 
 If I understood correctly, you have products which reference a criteria ID 
 which has no matching value. If this is the problem you have a to first take 
 care of the integrity of your data, as this should never happen. 
 
 
 -- 
 Simcha Younger sim...@syounger.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] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Oh yeah one other thing that confused me at first...

The various articles talk about having PHP installed as CGI, but all modern PHP 
installs include PHP command line interface (CLI). This serves the same 
purpose. No CGI required.

On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

 Hi gang,
 
 I use a Project Management System (PM) that generates emails to my account. I 
 can REPLY to that email and it will be inserted into the PM. I believe the ID 
 is in the subject. I assume the email is sent to a specified email and there 
 is a CRON JOB that runs a PHP script to query and parse the new emails and 
 insert them in to DB.
 
 Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
 have any tips/resource links or a product I can use to do this.
 
 Any feedback is appreciated!
 
 Don
 
 -- 
 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] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Weird! I just got back on this list by accident last night and I just happen to 
be writing one of these this moment.

The general scheme is:

-Create a mail alias that points to a PHP cli script.

-Write a script that parses out the DB stuff you need etc. (How hard can that 
be!?)

No need for cron or anything unless you expect heavy traffic and need to manage 
a queue.

It is a really cool feature. Next I need to handle attachments.

Google has some good stuff on this.

Good luck, Phred


On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

 Hi gang,
 
 I use a Project Management System (PM) that generates emails to my account. I 
 can REPLY to that email and it will be inserted into the PM. I believe the ID 
 is in the subject. I assume the email is sent to a specified email and there 
 is a CRON JOB that runs a PHP script to query and parse the new emails and 
 insert them in to DB.
 
 Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
 have any tips/resource links or a product I can use to do this.
 
 Any feedback is appreciated!
 
 Don
 
 -- 
 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] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Weird! I just got back on this list by accident last night and I just happen to 
be writing one of these this moment.

The general scheme is:

-Create a mail alias that points to a PHP cli script.

-Write a script that parses out the DB stuff you need etc. (How hard can that 
be!?)

No need for cron or anything unless you expect heavy traffic and need to manage 
a queue.

It is a really cool feature. Next I need to handle attachments.

Google has some good stuff on this.

Good luck, Phred


On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

 Hi gang,
 
 I use a Project Management System (PM) that generates emails to my account. I 
 can REPLY to that email and it will be inserted into the PM. I believe the ID 
 is in the subject. I assume the email is sent to a specified email and there 
 is a CRON JOB that runs a PHP script to query and parse the new emails and 
 insert them in to DB.
 
 Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
 have any tips/resource links or a product I can use to do this.
 
 Any feedback is appreciated!
 
 Don
 
 -- 
 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



[PHP] Blocking the direct download of a file

2007-05-07 Thread pw


Hello,

I have a phtml file that contains a reference to
a java archive (jar) file.

I only want the archive used in the context of
a specific html page. I don't want the archive
to be downloaded directly.

I thought, at first, I could just use a php page as my jar reference:


html
body

applet code=my.class archive=./jar.php width=100 height=100
/applet

/body
/html


I would then use the following in jar.php:

?php
$referrer=$_SERVER['HTTP_REFERRER'];
if(strcmp($referrer,http://www.myweb.com/index.phtml;)==0)
{

header(Location: ./primary.jar);
}
else
{
header(Location: ./secondary.jar);
}
?


The problem is I get a java.lang.ClassNotFoundException.

Is there a way to change a reference like this
'on-the-fly' so to speak?

Is my code wrong and this method can be modified
to work?


Thanks for any info,

Peter

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



[PHP] Is it possible to use header() to POST form data?

2005-12-15 Thread pw

Hello,

Does anyone know if it's possible to use the
header() function to POST form data to a URL?

If so what syntax needs to be used?

Thanks,

Peter

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



Re: [PHP] Is it possible to use header() to POST form data?

2005-12-15 Thread pw

Philip Hallstrom wrote:

Does anyone know if it's possible to use the
header() function to POST form data to a URL?

If so what syntax needs to be used?



No, but a quick search for HTTP POST PHP example will get you the code 
you need.




Thanks,

I googled and, as you said, there was code there.

'sendToHost'

Hopefully it's current enough to work for me.

Thanks again,

Peter

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



Re: [PHP] PHP/PearDB works on commandline but not via http....

2004-08-19 Thread pw

Justin Patrin wrote:

Did you try:
if(PEAR::isError($db)) {
  echo $db-getMessage().' '.$db-getUserInfo();
}
It's probably because:
1) the postgres the module isn't in the PHP that apache is using
2) the postgres module isn't loaded in the PHP that apache is using
3) the postgres module in the PHP that apache is using is connecting
via a socket instead of a port (or vice-versa)
I think you may have something with the apache module points.
I'll ask if apache has been built or is just the install from
the linux distro. I built apache previously, but I didn't install
this machine
Thanks for the ideas,
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP/PearDB works on commandline but not via http....

2004-08-18 Thread pw
Hello,
I have an interesting problem with PostgreSQL
via PearDB and PHP 4.3.3 .
I have a php page that opens a remote connection
to a Postgres database, performs a query, lists
the results and then closes the connection.
If I run the php from the command line the
connection and query work fine. Php dumps
a nice web page with all the data that I am asking for.
If I serve the same php page via apache
from the same machine, php fails to open
the database connection and thus the page
fails to fill out. PearDB is installed and working
since
if(DB::iserror($db))
  
detects the error.

Anyone have any ideas?
Thanks,
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP/PearDB works on commandline but not via http....

2004-08-18 Thread pw

Justin Patrin wrote:

Can't help you unless you give us an error...
There's no error.
DB_Error::toString()
returns the following.
[: message= code=0 mode= level= prefix= info=]
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP/PearDB works on commandline but not via http....

2004-08-18 Thread pw

Matthew Sims wrote:
And check to see that PostgreSQL is accepting network connections rather
than localhost. Is it listening to a port?
Connecting remotely to postgres via the command line:
psql -h nnn.nnn.nnn.nnn database_name -p 5432 -U user -W
works fine.
Like I wrote before, if I run the same script from the command line
with the same php build...
ie:
cmd_line/ php  db_test.php
the script works fine and retrieves data fromt he database.
If I try to serve the same php page via apache it
can't connect, thus no $db object is returned from
$db=DB::connect(pgsql://yada:[EMAIL PROTECTED]/databasename);
I've tried running the php as various users including apache from
the command line and it continues to work fine there. So, it's not
a user permissions thing.
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Running PHP as a CGI, chasing my own tail....(resolved)

2004-01-21 Thread pw

 CGI or CLI? I'm betting on the latter because I'm not aware.

Yes, available via CLI for CGI. My mistake.
The third party app has thread safety issues that require
php to be run as a command line CGI rather than a module.
The problem with the module, as stated perviously, is not with
php, but with the thread safety of the library that is being
used as an add-on to php.

of any
 feature a script could require that is only provided by the PHP
 executable and not the module. In which case you can have both the
 module and the CLI version running at the same time.

 -- 
 Stuart


This is the case with the redhat install that I have that is currently
working fine on a previous server. I was curious about issues that would
keep the same setup from working on a Mandrake box that has all
the same software.

The resolution to the problem was to completely remove
PHP and apache from the system and do a clean build of both with *known
configurations*. The web server was setup previously and was operating as a
legacy from some other project. PHP now works as a CLI when used for CGI
using the same httpd.conf as before.

Best Regards,

Peter

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



[PHP] Running PHP as a CGI, chasing my own tail....

2004-01-20 Thread pw
Hello,

I have looked over the various documentation regarding using
php as a CGI program.

What I have are PHTML scripts that I wish to run through
php via CGI, not through the module.

In my httpd.conf file I have placed the lines:

AddHandler phtml-script .phtml
Action phtml-script /cgi-bin/php

I have a symlink in my cgi-bin directory to the php executable.

Am I missing anything else to make this work?

Thanks for any insight.


Peter

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



Re: [PHP] Running PHP as a CGI, chasing my own tail....

2004-01-20 Thread pw
Hello,
Thanks for the info.
I am aware of the security problems around this. 
The methods described in the manual were not working
so I decided to try this on an internal server to find out why.

I am using apache 1.3.23 and 
php 4.3.3 on linux with a 2.4 kernel.

I can't use the php module because a third party application
requires php to be available via CGI.

The original apache config file settings work fine on one server
but don't on this server. I am trying to iron out why the difference.
The working server is Redhat and the non-working server is
Mandrake.

The original config files and builds use proper security techniques to
prevent php from redirecting outside the server document path.

I'll follow the links that you offered.

Peter

 
 A clue-by-four about security. If that was to work you would be opening 
 your server up to any kind of attack an attacker could thinking of. 
 We're talking *wide* open.
 
 1) Why can't you use the PHP module?
 
 2) What version of Apache are you using?
 
 If Apache 1.3, the manual[1] gives clear instructions on how to set this 
 up...
 Stuart
 
 


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



[PHP] PHP Apache Build Problem

2004-01-16 Thread pw
Hello,

I am trying to build php-4.3.3 into apache_1.3.28 as a module.
I configure php

--with-apache=/apache/source/path

and the php make process puts the source for mod_php4 into

/apache/source/path/src/modules/php4/
/apache/source/path/src/include/ap_config.h:77:28: ap_config_auto.h: No such
file or directory
I then configure apache with:

./configure --prefix=/usr/local/apache --add-module=src/modules/php4/mod_php
4.c

The apache autoconf configure script generates a Makefile with no errors.

When I try to build apache with 'make' everything compiles fine until the
build of mod_php4 comes up.

Make complains that it can't find headers:

=== src/modules/extra
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DUSE_HSREGEX -DUSE_EXP
AT -I../../lib/expat-lite -DNO_DL_NEEDED `../../apaci` mod_php4.c
mod_php4.c:22:29: php_apache_http.h: No such file or directory
In file included from mod_php4.c:23:

What's wrong with my build?

Thanks for any info.

Peter

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



Re: [PHP] PHP Apache Build Problem (Correction to original question)

2004-01-16 Thread pw


 /apache/source/path/src/modules/php4/
 /apache/source/path/src/include/ap_config.h:77:28: ap_config_auto.h: No
such
 file or directory

This goes away if I run 'configure' once for apache.
Then I carry on as in the previous post.

Sorry about my editing.

Peter

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



[PHP] problem generating PNG using image functions

2003-11-18 Thread pw
Hello,

I have some php code that I moved from one serve to another.
The code in question generates some PNG images on the fly
and works nicely on the old server.
After moving the code to the new server only one
of the PNG images now draws. The other images
come back with :

 The image http://url; cannot be displayed, because it contains errors.

Why would php generate one image but not the others?
(keep in mind that the code is known to work fine on another server)

Peter

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



Re: [PHP] problem generating PNG using image functions

2003-11-18 Thread pw
Hello again,

I just found the problem:

Fatal error:  imageellipse(): requires GD 2.0 or later in imgtest.php on
line 271Hope this helps someone else.Peter

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