Re: [PHP] Reading class variable value always returns NULL

2012-08-15 Thread Philipp Gysin
As a little clarification: The Apache server in question is configured as a
MPM prefork.


On Wed, Aug 15, 2012 at 4:28 PM, Reto Kaiser r...@cargomedia.ch wrote:

 So here's some new observations on the instance variables being NULL.
 As far as we found out this is the sequence of events:

 1. Apache (MPM) received request A which executes a php script.
 2. Within this script during the unserialization of an object an
 exception is thrown.
 3. This exception is catched and an error message is display to
 standard output with echo.
 4. The script ends normally and the standard output contents are
 returned in the HTTP response.
 5. From now on this Apache worker is tainted, meaning that every
 subsequent request will result in:

 6. The same apache worker receives request B which executes a PHP script.
 7. Within this PHP script reading instance variables will always
 return NULL, e.g.:

 ?php
 class A{}
 $a = new A();
 $a-foo = 1;
 // Now: $a-foo === NULL

 All subsequent requests to this apache worker will behave like this.
 The constellation leading to this behavior is very hard to further
 simplify. If we throw different exceptions, or unserialize different
 objects it doesn't happen anymore...


 As a workaround we added exit; to the end of our php script. With a
 call to exit the apache worker will not get tainted...

 Regards,
  Reto



 On Tue, Aug 14, 2012 at 11:52 PM, Reto Kaiser r...@cargomedia.ch wrote:
  Hey,
 
  We have:
  error_reporting((E_ALL | E_STRICT)  ~(E_NOTICE | E_USER_NOTICE));
 
  Displaying errors is disabled:
  display_errors = Off
 
  We have a custom error handler which logs all errors to a file.
  In this file we receive byeffect errors, like that the second argument
  to array_key_exists should be array, but is NULL. When we further
  debug the reason is that the second argument is an instance variable,
  and all instance variables are NULL.
  We're pretty sure this is a software bug, since it only happens from
  time to time, and already happens in the first line of the php script,
  when none of our application code was loaded.
  For example:
 
  ?php
  class A{}
  $a = new A();
  $a-foo = 1;
  if ($a-foo === null) {
   throw new Exception(strange);
  }
 
  will throw an exception.
 
  Since it only happens from time to time, it is really hard to debug.
  We're now trying to reproduce in a virtual machine environment, while
  replaying the actual requests that our webserver received. When we're
  just simulating random load on the web server it doesn't happen. So it
  must have something to do with certain requests, and they must have
  some strange byeffect on php, or mod_php or something related.
 
  Any input welcome!
 
  Thanks,
   Reto
 
  On Tue, Aug 14, 2012 at 11:11 PM, Jim Lucas li...@cmsws.com wrote:
  On 08/12/2012 05:32 AM, Reto Kaiser wrote:
 
  Hi,
 
  So I have this strange situation where I assign a classvariable a
  value, but when I read the value it is NULL.
 
  Does anyone have an idea what could cause this, or how to further
 debug?
 
  Thanks,
Reto
 
 
  What is your error reporting set to?
 
  Do you have display errors turned on?
 
  Are you saving your errors to a log file?
 
  --
  Jim Lucas
 
  http://www.cmsws.com/
  http://www.cmsws.com/examples/



[PHP] Help: PHP version not up to date after apt-get install php5-dev

2009-06-17 Thread Philipp Schaffner

Dear PHP [hard]core expert

After  apt-get install php5-dev on Linux (Debian, Ubuntu, Hardy Heron) 
with an already existing and functioning PHP5 interpreter phpinfo() still 
shows PHP Version 5.2.4-2ubuntu5.6. BUT at the same time phpinfo() shows 
Build Date: April 17 2009!


This seems incongruent to me! PHP 5.2.4 is from the year 2007!!! Which 
version of PHP does my server run now? How can I find out in this mess? Do 
I really need to deinstall and reinstall PHP in order to get the right 
version displayed?


Thank you very much for your brief info about this confusion!
Philipp Schaffner, Switzerland



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



Re: [PHP] Video question

2006-12-20 Thread Philipp Schwarz
You can put the video into a flash file and start playing the video with 
Javascript. If someone downloads the video, he will see a blank page, 
because of the missing start command from Javascript.


Problem: If someone downloads the compleate page, he can watch the video.

You can solve this by using complicated AJAX structures, but if someone 
tracks the AJAX-traffic it will be easy to start the video.


In fakt there is no way to prevent videos from downloading. If the 
browser can play the video, than there is a way to get it.


MfG Philipp

John Messam schrieb:

How do I display video on my php page and prevent the video from being
downloaded.

  


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



[PHP] Which PHP-script crashes my server?

2006-12-19 Thread Philipp Schwarz

Hi guys,

I have a problem with my webserver. It is a server for me and some web 
projekts of my friends. And there is one PHP script which kills the 
whole server, but I do not know which one it is. When the server is 
going down one apache process uses 99% CPU and memory. In this case I 
can only reboot the server.


I would look up the file in the apache logs, but the script is started 
some minutes before the server goes down and there are some hundred 
requests per minute.


Can anyone help me?

Thank you!

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



Re: [PHP] Which PHP-script crashes my server?

2006-12-19 Thread Philipp Schwarz

Linux, of course. :-)
It is a Gentoo server with Confixx Pro on it. The PHP safe mode is 
disabled for some accounts, so it is clear that problems like this 
happen. But I can not enable it because of several scripts.


Thats all I know. I dit not setup the server. If you need some special 
information, tell me which one.


Vincent DUPONT schrieb:

hello, could you tell us more about our webserver?
Linux or windows? 


vincent

  


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



Re: [PHP] If array()

2006-10-10 Thread Philipp Schwarz

Try this:

if (is_array($array)  count($array)) {
   ...
}

John Taylor-Johnston schrieb:

How can I use if to see an array contains something?

if ($array()) does not work, of course.

John




--
Mit freundlichen Grüßen

Philipp Schwarz
-
comtrance 


E-Mail: [EMAIL PROTECTED]
Internet:   http://www.comtrance.net
Telefon:+49 (211) 27159 - 20
Fax:+49 (211) 54423 - 05

Anschrift:  comtrance GmbH
   In der Steele 20
   40599 Düsseldorf

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



Re: [PHP] test

2006-10-04 Thread Philipp Schwarz

Stupid?

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



[PHP] Re: Php function to Set focus On A form Field

2006-04-26 Thread Philipp Kopf

marvin hunkin schrieb:

Hi.
is there any php or java script function, where i can embed into my php 
or html file, to set focus on to the first form field, like a text box, 
to go to that field first, and not to go to the link or button first.
if there are any tips, tricks, or links or code examples, how to fix 
this problem.

let me know.
cheers Marvin.


Hi.

It is not possible to do that using PHP but you can use JavaScript 
instead. I recommend the function focus(). For example:

BODY OnLoad=document.nameform.user.focus();

Check this tiny tutorial: 
http://javascript.internet.com/page-details/focus-onload.html


Did you already remarked that http://www.google.com is using this 
function to automatically set the focus on the search field.


regards

Philipp

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



[PHP] Re: Error when I try to display 20 records per page

2004-11-16 Thread Philipp Lutz
Scott McWhite wrote:
$row = mysql_fetch_array($result); //get a row from our result set
a bit farther down...
while($row = mysql_fetch_array($result)){
Dude !
 You're like pulling the same results from the same query/resultset 
twice (..and stuff). You can't do that, man. You have to redo the query.

(Sorry, I just watched Hurley from Lost :-) )
Phil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Auth class----MySQL user

2004-09-08 Thread Philipp Wendisch
Pahlevanzadeh Mohsen wrote:
Dears,My code is :
?
function Login()
 {
  echo xxx;
  echo form method=\post\
action=\.$_SERVER['PHP_SELF'].  \\;
  echo input type=\text\ name=\u\ br /;
  echo input type=\password\ name=\p\ br /;
  echo input type=\submit\;
  echo /form;
 }
 $username=$_POST['u'];
 $password=$_POST['p'];
 echo md5('mohsen');
$parameterforauth=array(dsn=mysql://$username:[EMAIL PROTECTED]/mem,
 table=usernames,
 usernamecol=user,
 passwordcol=pass);
 $ptr_auth_C=new Auth(DB,$parameterforauth,'Login');
 $ptr_auth_C-start();
 if ($ptr_auth_C-getAuth())
   echo Successfuly loggined!!!;
?
I have opened mysql shell, i have typed following
statement:
use mem
grant all privileges on usernames to [EMAIL PROTECTED];
set password for mohsen=password('loverx');
insert into usernames values
(user='mohsen',pass=md5('loverx'));
commit;
But i can't loggin into my program.(with mohsen as
username  loverx as password)
Thsu i can't see Successfuly loggined!!!
Please guide me.
Yours,Mohsen.

=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator   programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net


simple answer:
read the manual about Auth, and you will notice the warning:
You can change all the HTML formatting in the function, but you cannot change 
the names of the input boxes in the form. They have to be username and password.

after changing the names, you will see, that it works ;-)
greets
Philipp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] question about GD and colors

2003-01-28 Thread Philipp
Hi,


question was answered yesterday on the list.
there is a new function imagecreatetruecolor().
use this instead of imagecreate().


Regard,
Philipp


- Original Message -
From: nospam [EMAIL PROTECTED]
To: 'Jean-François Marseaut' [EMAIL PROTECTED]
Cc: 'Php-General [EMAIL PROTECTED]
Sent: Monday, January 27, 2003 5:48 PM
Subject: RE: [PHP] question about GD and colors


Hi

I have the same Problem with the bundeled libary.
I hade no time to fill in a bug report at bugs.php.net.
Probably you could?

regards
Sebastian



 -Original Message-
 From: Jean-François Marseaut [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 27, 2003 5:16 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] question about GD and colors


 With this script under, I get resized image in only 16
 colors. with an old version of gd, I got 16 million colors
 images. Has someone a response ?


 ?PHP
 /***
 file [string] - filename jpg
 w [int] - width
 /

 header(Content-type: image/png);

 $file = urldecode($file);
 $file = ../.$file;

 $infofile = getimagesize($file);
 $long = $infofile[1];
 $haut = $infofile[0];
 $type = $infofile[2];

 if ($long$w) $w=$long;


 $ratio = $haut / $w;
 $h = $long / $ratio;

 if ($h$w)
 {
   $h = $w;
   $ratio = $long / $w;
   $w = $haut / $ratio;
 }


 $h = (int)$h;

 $dst_img = ImageCreate($w, $h);
 $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);

 switch ($type)
 {
 case 1 :
 $src_img=ImageCreateFromGif($file);
 break;
 case 2 :
 $src_img=ImageCreateFromJpeg($file);
 break;
 case 3 :
 $src_img=ImageCreateFromPng($file);
 break;
 case 6 :
 $src_img=imagecreatefromwbmp($file);
 break;
 default :
 ImagePng($dst_img);

 }

 imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
 ImageSX($src_img), ImageSY($src_img));
 imagepng($dst_img);


 --
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] question about GD and colors

2003-01-27 Thread Philipp
Hi experienced the same problem with the new
bundled version of GD.

regards,
philipp


- Original Message -
From: Jean-François Marseaut [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 27, 2003 5:15 PM
Subject: [PHP] question about GD and colors


 With this script under, I get resized image in only 16 colors. with an old
 version of gd, I got 16 million colors images. Has someone a response ?


 ?PHP
 /***
 file [string] - filename jpg
 w [int] - width
 /

 header(Content-type: image/png);

 $file = urldecode($file);
 $file = ../.$file;

 $infofile = getimagesize($file);
 $long = $infofile[1];
 $haut = $infofile[0];
 $type = $infofile[2];

 if ($long$w) $w=$long;


 $ratio = $haut / $w;
 $h = $long / $ratio;

 if ($h$w)
 {
   $h = $w;
   $ratio = $long / $w;
   $w = $haut / $ratio;
 }


 $h = (int)$h;

 $dst_img = ImageCreate($w, $h);
 $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);

 switch ($type)
 {
 case 1 :
 $src_img=ImageCreateFromGif($file);
 break;
 case 2 :
 $src_img=ImageCreateFromJpeg($file);
 break;
 case 3 :
 $src_img=ImageCreateFromPng($file);
 break;
 case 6 :
 $src_img=imagecreatefromwbmp($file);
 break;
 default :
 ImagePng($dst_img);

 }

 imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
 ImageSX($src_img), ImageSY($src_img));
 imagepng($dst_img);


 --
 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] question about GD and colors

2003-01-27 Thread Philipp
Hi Adrian,

thank you very much, that solved my problem.


Regards,
Philipp



- Original Message -
From: adrian [EMAIL PROTECTED] [EMAIL PROTECTED]
To: Philipp [EMAIL PROTECTED]; Jean-François Marseaut
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, January 27, 2003 6:10 PM
Subject: Re: [PHP] question about GD and colors


 try imagecreatetruecolor()  instead of imagecreate()

 - Original Message -
 From: Philipp [EMAIL PROTECTED]
 To: Jean-François Marseaut [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Monday, January 27, 2003 4:21 PM
 Subject: Re: [PHP] question about GD and colors


  Hi experienced the same problem with the new
  bundled version of GD.
 
  regards,
  philipp
 
 
  - Original Message -
  From: Jean-François Marseaut [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, January 27, 2003 5:15 PM
  Subject: [PHP] question about GD and colors
 
 
   With this script under, I get resized image in only 16 colors. with an
 old
   version of gd, I got 16 million colors images. Has someone a response
?
  
  
   ?PHP
   /***
   file [string] - filename jpg
   w [int] - width
   /
  
   header(Content-type: image/png);
  
   $file = urldecode($file);
   $file = ../.$file;
  
   $infofile = getimagesize($file);
   $long = $infofile[1];
   $haut = $infofile[0];
   $type = $infofile[2];
  
   if ($long$w) $w=$long;
  
  
   $ratio = $haut / $w;
   $h = $long / $ratio;
  
   if ($h$w)
   {
 $h = $w;
 $ratio = $long / $w;
 $w = $haut / $ratio;
   }
  
  
   $h = (int)$h;
  
   $dst_img = ImageCreate($w, $h);
   $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
  
   switch ($type)
   {
   case 1 :
   $src_img=ImageCreateFromGif($file);
   break;
   case 2 :
   $src_img=ImageCreateFromJpeg($file);
   break;
   case 3 :
   $src_img=ImageCreateFromPng($file);
   break;
   case 6 :
   $src_img=imagecreatefromwbmp($file);
   break;
   default :
   ImagePng($dst_img);
  
   }
  
   imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
   ImageSX($src_img), ImageSY($src_img));
   imagepng($dst_img);
  
  
   --
   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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] problems getting GD to wrok properly

2003-01-24 Thread Philipp
Hi,


i am having problem to get GD working properly.
i used to compile GD by myself an link the libgd.a
into PHP, but as PHP 4.3.0 offers an included
version, and besides its recommonded to use it,
it saves some work. but i cant get it to work right.
the problem is the jpeg support. is it build in ?
do i need other libraries/software installed ?

here is what i have/did:

debian woody
libjpeg 62 and libjpeg-dev installed
libgd-2 and libgd2-dev installed
apache 1.3.27

i used this configure command:

./confiigure --prefix=/usr/local/php-4.3.0 --with-gd --with-jpeg --with-png 
--with-apache=../apache-1.3.27
--with-mysql=/usr/local/mysql --with-zlib

its hexed ! it always tells me: CreateImageFromJpeg in -lgd: no !


Perhaps someone can give me a brief installed if i did something wrong and
perhaps
a little recipe what he/she did to get it work.


thanks alot,
philipp


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




[PHP] 4.3.0 cpu load raise

2003-01-20 Thread Philipp
Hello !


i upgraded PHP last week. I used 4.2.3 and now
i am using 4.3.0. The System is Linux running
a 2.4.20 kernel and Apache 1.3.27 with PHP
statically compiled in.

I recognized a significant load-raise. it seems
that the new version needs more CPU power
to complete its tasks.

i will evaluate my atsar logs to verify my assumption,
but i like to know if others experienced similar behavior
on their webservers.


Thank you very much,
Philipp


[PHP] dynamic variables in a while loop?

2003-01-15 Thread Philipp Hartmann
Hi everyone.
I am more of an ActionScript person, but I have to do this one in php.
Should
be easy for everyone familiar with php syntax...

Here is what I want to do:
I am getting several variables into a Php Script such as:

help1 = yes / no
help2 = yes / no
.
.
.
helpX = yes / no

I need to check whether the variable is true or false, and according to that
add
1 to a counter variable.

Something like this I'd do in ActionScript, but dont know about php
[CODE]
$i = 0;
While (++$i = 8) {
if ([help]+$i==yes){ // this line produces an error...
$counterYes += counterYes;
}
}
[/CODE]

Do I have to initialize all variables before I can use them in php?

Thank you very, very much for your time and your help!!
Philipp


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




Re: [PHP] dynamic variables in a while loop?

2003-01-15 Thread Philipp Hartmann
Thanks everyone!
Works great!
Phil

- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: Philipp Hartmann [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 2:03 PM
Subject: Re: [PHP] dynamic variables in a while loop?


 for($ii=1; $ii20; $ii++)
 {
 $helpz = help$ii;
 if(${$helpz} == yes)
 {
 }
 else
 {
 }
 }
 - Original Message -
 From: Philipp Hartmann [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 15, 2003 6:50 AM
 Subject: [PHP] dynamic variables in a while loop?


 Hi everyone.
 I am more of an ActionScript person, but I have to do this one in php.
 Should
 be easy for everyone familiar with php syntax...

 Here is what I want to do:
 I am getting several variables into a Php Script such as:

 help1 = yes / no
 help2 = yes / no
 .
 .
 .
 helpX = yes / no

 I need to check whether the variable is true or false, and according to
that
 add
 1 to a counter variable.

 Something like this I'd do in ActionScript, but dont know about php
 [CODE]
 $i = 0;
 While (++$i = 8) {
 if ([help]+$i==yes){ // this line produces an error...
 $counterYes += counterYes;
 }
 }
 [/CODE]

 Do I have to initialize all variables before I can use them in php?

 Thank you very, very much for your time and your help!!
 Philipp


 --
 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] flash and php (using the varibles)

2003-01-09 Thread Philipp Hartmann
I didnt test this, but something along the line should work

[ActionScript]
onEnterFrame = function{
i  = dataYougetFromMySQL;
if (i  max){
this._width = this._width * (i*factor) // factor can slow down or accelerate
your animation
}
}
[/ActionScript]

hth,
Philipp


- [ Paul Ferrie ] - [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi guys i hope there is someone in here that use flsah along with php to
 help with this :)

 Anyway i will make it simple.

 mysql returns a number say 123 i want flash to take this number to animate
a
 progress bar, but here the problem it does work but the progress bar
dosn't
 animate it just sets to the hieght of the numbers sent back from mysql.
How
 can i slow down the animation of the progress bar

 Anyone



 --
 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] HTML email that generates !s - any ideas?

2003-01-08 Thread Philipp Hartmann
Hi everyone, I am new to this list, so this is my first post.

I am trying to sen dan HTML email, and so far I got everything running,
except for one very odd problem.

1.) I am setting up all my variables within the .php Script.
2.) I generate my HTML email
3.) I am outputting the email to the browser and send it to myself

-- Now here comes the problem:

In the browseroutput the text looks like I want it to be. In the email
however,
there are several EXCLAMATION MARKS (!) added to the code (and therefore
the body).
How can this happen?? Is there some trick I have missed? The exclamation
marks are
positioned within the email according to the amaount of characters I submit
with the
email.

I have set up a simple page where you can view the .php file, the output and
the email.

http://www.gsdh.org/pleasehelp/index.html

If anyone of you could spare the time, I would be really gratefull as I have
to finish this but am
stuck!  :(

Thans again,
Philipp


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




[PHP] How to echo the end marker '?'

2002-11-08 Thread Philipp Bolliger
Hi everyone,

subject's allready my question ! I want to echo something like : form 
action = \,?php echo $PHP_SELF ? \  so that the action becomes ? 
echo $PHP_SELF ? !! But I can't figure out how to escape ? so that the 
 interpreter doesn't take it as the end of the script ! Any idea ?

cheers, phibo


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



Re: [PHP] need help for a where clause

2002-10-07 Thread Philipp Lutz

If you are using MySQL you may want to look at the CASE statement in the
Control flow functions for use with SELECT Statements
 it would look like
SELECT
CASE A.Afn
  WHEN 1 THEN B.Bfn1
  WHEN 2 THEN B.Bfn2
  WHEN 3 THEN B.Bfn3
   FROM A,B
IN MySQL
Hope That Helps.. Phil

Alex Shi [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks! This is what I need!

 Alex Shi



 Sascha Cunz [EMAIL PROTECTED] ??
 :[EMAIL PROTECTED]
 A solution on that depends strongly on how much values A.Afn would take.
For
 3, it's still okay. But i wouldn't do more.

 Against what shall the B.Bfn* be checked? What Data do you want to be
 returned
 from the query?

 try:

 SELECT ### FROM A, B WHERE
   ((A.Afn=1) AND (B.Bfn1 = ...)) OR
   ((A.Afn=2) AND (B.Bfn2 = ...)) OR
   ((A.Afn=3) AND (B.Bfn3 = ...))

 where you should replace ### with things you want to select and ... with
the
 things you want to check.

 On more than 3 different values for A.Afn, you should use a more
normalized
 version of B.

 i.e.: B contains only one Bfn field and a Reference to A.Afn.
  - SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ...

 Sascha

 Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi:
  Hi,
 
  I need a where clause in following situation:
 
  Say I want to query two tables: A and B. In table A there is field
  Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want
  to do a query, in which the where clause must do these things:
 
  if A.Afn=1, then check value of B.Bfn1;
  if A.Afn=2, then check value of B.Bfn2;
  if A.Afn=3, then check value of B.Bfn3.
 
  So how can I create such a where clause to do this?
  Thanks in advance!
 
  Alex Shi




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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread Philipp Lutz

Read closely ! There are extra apostrophes inside the quotes !!
Phil

Lallous [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 John, what you said would simply produce:
var x = ['str1,str2,str3']
 and not as I want:
   var x = ['str1','str2','str3']


 Elias,

 John W. Holmes [EMAIL PROTECTED] wrote in message
 002101c26de2$982bf7d0$7c02a8c0@coconut">news:002101c26de2$982bf7d0$7c02a8c0@coconut...
 
 
   -Original Message-
   From: lallous [mailto:[EMAIL PROTECTED]]
   Sent: Monday, October 07, 2002 6:09 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] join() , can do that fast?
  
   Hello,
  
  
   I have:
   $x = array('str1','str2','str3');
  
   I want to convert that array to a valid javascript syntax as:
  
   var x = ['str1','str2','str3']
  
   I can do this in PHP:
  
   echo sprintf(x=[%s], join(',', $x));
 
  echo sprintf(x=['%s'], join(',', $x));
 
   but that would produce:
   x = [str1, str2, str3]
  
   is there is a fast way (other than doing a loop) to have join put
  quote
   around each array value before joining? so final result looks like:
   ['str1','str2',...
 
  ---John Holmes...
 
 





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




[PHP] Linux DBG-GUI

2002-06-14 Thread Philipp Melab

I'm using SuSE 8.0 and i need a free GUI to use with DBG.

yours   Philipp

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




[PHP] php-speed

2002-06-13 Thread Philipp Melab

I have a simple newbie question...
Whats better (faster?):

- embedding PHP in HTML
- or printing HTML via PHP
...?

yours Philipp

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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes


Leon Mergen wrote:

 
 Philipp Melab [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 - embedding PHP in HTML
 - or printing HTML via PHP
 
 With embedding PHP in HTML, do you mean using server side includes or do
 you mean by having a .php file and having a layout like this:
 
 html
 head
 title?=$title;?/title
 body
 ?
 code();
 ?
 /body
 /html
 
 Regards,
 
 Leon Mergen


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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes, Ithought that embedding must be faster too. But I was confused because 
in nearly every PHP-Beginner Tutorial/Book I've seen the Hello-World 
Example looks like this:

?
echo html;
echo head;
echo title.../title;
echo /head; 

echo body;
echo pHello World!/p;
echo /body;
echo /html;
?

funny, isn't it?

yours, Philipp

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




Re: [PHP] Editor

2002-06-13 Thread Philipp Melab

I love emacs with php-mode.el.
He's small, reliable, customizable and if you've ever worked with Komodo or 
Zend IDE you'll find out that he's damn fast.

yours Philipp


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




[PHP] dbugging via DBG

2002-06-11 Thread Philipp Melab

Das anybody know a good tutorial which tells me how to install and use the 
DBG php-debugger?

yours   Philipp

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




[PHP] mysql_fetch_object in a class

2002-05-29 Thread Philipp Melab

I'm trying to create a server-side tree-menue. Therefore I wrote a class

Does anybody know why it doesnt work?
there is a mysql_table named menue with the cols 'menue_id', 'name', 
'parent_id'.
$open is a global array with entries who tell me which menue-points where 
clicked.


class menue_point
{
var $menue_id;
var $name;
var $lvl;
var $open;
var $children;

function menue_point($point, $lvl)
{
global $open;
$this-menue_id = $point-menue_id;
$this-name = $point-name;
$this-lvl = $lvl;
$this-open = $open[$this-lvl];
$this-children = array();

if($this-open == $this-menue_id)
{

$child_id = $this-menue_id;
$childquery = SELECT * FROM menue WHERE parent_id=$child_id;;
$childresult = mysql_query($childquery)or die(mysql_error());
$next_lvl = $this-lvl + 1;

while($CHILDPOINT = mysql_fetch_object($childresult));
{
$child = new menue_point($CHILDPOINT, $next_lvl);
array_push($this-children, $child);
}
}
}
}


It seems like '$CHILDPOINT' was empty, because the new point is 'born' but 
all the vars in it are empty...

yours   Philipp

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




[PHP] W98se, PWS 4.0, IE 5.5 php wird nicht interpretiert

2001-01-21 Thread Philipp Althaus

trotz viel Nachlesen und ben schaffe ich es nicht php zum Laufen zu bringen.
Bin neu in der PHP-Welt. 

ich mchte PHP ausprobieren und local installieren auf Notebook zum Testen. 
Leider wird der php-Code nicht interpretiert. Nachfolgend meine Daten:

Problem:  php-Code wird nicht interpretiert

html
head
titleBeispiel/title
/head
body
test 1
?php echo "Hallo, ich bin ein PHP-Skript!"; ?
/body
/html

es wird nur test 1 angezeigt



Windows 98 SE  mit  PWS 4.0  Explorer 5.5  ,  PWS funktioniert
PWS-Basis-Verzeichnis : d:\windows\wwwroot


php-4.0.4-win32.zip gemss Anleitung installiert
d:\programme\php


php-4.0.4-installer.exe ausgefhrt


php registriert:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="D:\Programme\php\sapi\php4isapi.dll"
".php3"="D:\Programme\php\sapi\php4isapi.dll"
".php4"="D:\Programme\php\sapi\php4isapi.dll"

HKEY_CLASSES_ROOT
.phpphpfile
.php3   "
.php4   "

phpfile shell open command  : d:\programme\php\sapi\php4isapi.dll

Explorer  5.5 erkennt php-Files als PHP-Script


php.ini angepasst:

;
; Paths and Directories ;
;
include_path =   d:\windows\wwwroot  
doc_root = d:\windows\wwwroot 
user_dir = d:\programme\php 
extension_dir = d:\programme\php\extensions 
enable_dl  = On 

[browscap]
;browscap = extra/browscap.ini
browscap = d:\windows\system\inetsrv\browscap.ini


wer weiss was falsch ist ?

Danke fr eine kurze Nachricht.

freundlich grsst Philipp