php-general Digest 7 Oct 2004 04:34:13 -0000 Issue 3038

Topics (messages 198758 through 198791):

Referencing a "constant" class variable
        198758 by: Chris Boget
        198764 by: Greg Donald
        198765 by: Greg Donald
        198767 by: Daniel Schierbeck
        198768 by: Chris Boget
        198769 by: M. Sokolewicz
        198771 by: Chris Boget
        198776 by: Jennifer Goodie
        198781 by: David Bevan

displaying blob images from a mssql db
        198759 by: blackwater dev

Re: proper method to do the following...
        198760 by: Dennis Gearon

Re: --disable-url-fopen-wrapper gone?
        198761 by: Paul Fierro

Saving non-english text into database problem !!
        198762 by: Dre
        198766 by: Marek Kilimajer
        198788 by: Dre

Re: why this doesn't work as an external file but does inte rnally?
        198763 by: Vail, Warren

Push file to FTP Server
        198770 by: Aaron Todd
        198772 by: Aaron Gould
        198773 by: Matt M.
        198774 by: John Nichel

Re: SOLVED: why this doesn't work as an external file but does internally?
        198775 by: Aaron Wolski
        198780 by: Brian
        198789 by: John Nichel

Newsgroups Space
        198777 by: Joe Crawford
        198778 by: Jay Blanchard
        198779 by: Robert Sossomon
        198782 by: Matthew Sims

Re: **[SPAM]** RE: [PHP] Newsgroups Space
        198783 by: Jay Blanchard

Re: Suggestion for "IN()"
        198784 by: Shawn McKenzie

Re: Images in PHP and MySQL
        198785 by: Ed Lazor
        198790 by: Gary Hotko

mysqli -> mysql
        198786 by: Whitehawk Stormchaser
        198787 by: Marek Kilimajer

Re: HOWTO: Install PHP on Fedora Core / Redhat
        198791 by: Luis Bernardo

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
If I have a class that looks like this:

class MyClass {
  var $MyClassVar = "Bob";
}

is there a way to reference that variable w/o instantiating
MyClass?  I've tried:

MyClass::$MyClassVar
MyClass->$MyClassVar
MyClass.$MyClassVar

nothing works.  Is this even possible?  I'm using PHP 4.3.2.

thnx,
Chris

--- End Message ---
--- Begin Message ---
On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget <[EMAIL PROTECTED]> wrote:
> If I have a class that looks like this:
> 
> class MyClass {
>   var $MyClassVar = "Bob";
> }
> 
> is there a way to reference that variable w/o instantiating
> MyClass?  I've tried:

MyClass::MyClassVar



-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
On Wed, 6 Oct 2004 13:02:18 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:
> On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget <[EMAIL PROTECTED]> wrote:
> > If I have a class that looks like this:
> >
> > class MyClass {
> >   var $MyClassVar = "Bob";
> > }
> >
> > is there a way to reference that variable w/o instantiating
> > MyClass?  I've tried:
> 
> MyClass::MyClassVar

That's wrong, I was thinking of functions.  Sorry.

Seems you have to instantiate the class.

class MyClass {
    var $MyClassVar = "Bob";
}

$class = new MyClass;
echo $class->MyClassVar;


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message --- Greg Donald wrote:
On Wed, 6 Oct 2004 13:02:18 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:

On Wed, 6 Oct 2004 11:08:22 -0500, Chris Boget <[EMAIL PROTECTED]> wrote:

If I have a class that looks like this:

class MyClass {
 var $MyClassVar = "Bob";
}

is there a way to reference that variable w/o instantiating
MyClass?  I've tried:

MyClass::MyClassVar


That's wrong, I was thinking of functions.  Sorry.

Seems you have to instantiate the class.

class MyClass {
    var $MyClassVar = "Bob";
}

$class = new MyClass;
echo $class->MyClassVar;


I believe you can make the property static (at least in PHP5):

class MyClass
{
        public static $myClassVar = "Bob";
}

echo MyClass::$myClassVar; // Bob

--
Daniel Schierbeck

Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/register&r=6584
--- End Message ---
--- Begin Message ---
> I believe you can make the property static (at least in PHP5):
> class MyClass
> {
> public static $myClassVar = "Bob";
> }
> echo MyClass::$myClassVar; // Bob

Unfortunately, in PHP4.3.2 that doesn't seem to be working... :(
Does anyone know how I can access a class' variable w/o having
to instantiate an object of the class?  This is more to the point of
what I'm trying to do:

Since PHP4 doesn't have enums, I'm doing this:

class MyEnums {
  var $this = 'This';
  var $that = 'That';
  var $other = 'Other';
}

class MyClass {
  var $MyVar = MyEnums::$this;
}

But obviously, that's not working.  Is there a way I can get
it to work?

thnx,
Chris

--- End Message ---
--- Begin Message --- Chris Boget wrote:
I believe you can make the property static (at least in PHP5):
class MyClass
{
public static $myClassVar = "Bob";
}
echo MyClass::$myClassVar; // Bob


Unfortunately, in PHP4.3.2 that doesn't seem to be working... :(
Does anyone know how I can access a class' variable w/o having
to instantiate an object of the class?  This is more to the point of
what I'm trying to do:

Since PHP4 doesn't have enums, I'm doing this:

class MyEnums {
  var $this = 'This';
  var $that = 'That';
  var $other = 'Other';
}

class MyClass {
  var $MyVar = MyEnums::$this;
}

But obviously, that's not working.  Is there a way I can get
it to work?

thnx,
Chris

class MyEnums { var $this = 'This'; var $that = 'That'; var $other = 'Other'; }

 class MyClass {
   var $MyVar = MyEnums::this;
 }

reference like MyClass::MyVar. Don't use PHP5 conventions in PHP4!
--- End Message ---
--- Begin Message ---
> reference like MyClass::MyVar. Don't use PHP5 conventions in PHP4!

I'm curious if you tested your code?  Did it work?  If so, what
version of PHP are you using?  I copied and pasted the code
you provided and got the following error:

Parse error: parse error, expecting `','' or `';'' in
/usr/local/etc/httpd/domains/eazypro.com/interactive/cron_scripts/test/rate_
version.php on line 9

with line 9 being this line:

    var $MyVar = MyEnums::thisVar;

thnx,
Chris

--- End Message ---
--- Begin Message ---
-------------- Original message from "Chris Boget" : -------------- 
> Parse error: parse error, expecting `','' or `';'' in 
> /usr/local/etc/httpd/domains/eazypro.com/interactive/cron_scripts/test/rate_ 
> version.php on line 9 
> 
> with line 9 being this line: 
> 
> var $MyVar = MyEnums::thisVar; 
> 

That is because "In PHP 4, only constant initializers for var  variables are allowed. 
To initialize variables with non-constant values, you need an initialization function 
which is called automatically when an object is being constructed from the class." 
(from the manual)  

Whether or not the syntax MyEnums::thisVar is correct and will accomplish what you 
want when moved into a function is another story.

I haven't been paying close attention and am not sure what you are trying to do, but 
since it appears you want something that is constant, have you thought about using 
DEFINE?  

--- End Message ---
--- Begin Message ---
On October 6, 2004 15:34, Chris Boget wrote:

> Unfortunately, in PHP4.3.2 that doesn't seem to be working... :(
> Does anyone know how I can access a class' variable w/o having
> to instantiate an object of the class?  This is more to the point of
> what I'm trying to do:
>
> Since PHP4 doesn't have enums, I'm doing this:
>
> class MyEnums {
>   var $this = 'This';
>   var $that = 'That';
>   var $other = 'Other';
> }

Chris,

A work around I've used in the past has been to use a keyed array such as:

$MyEnums = array(
        "is" => "This",
        "at" => "That",
        "er" => "Other"
);

Then you can refer to them like:

echo($MyEnums["is"]);   // Prints "This"

Just an idea.
HTH
-- 
Regards,
David Bevan

We could learn a lot from crayons: 
some are sharp, some are pretty, some are dull, some have weird names, 
and all are different colors....but they all exist very nicely in the same 
box. 

--- End Message ---
--- Begin Message ---
Ok, I know images shouldn't be saved in the db but this isn't my db so
I can't change that.  Does anyone know of a good tutorial to show me
how to grab these blog jpg's and display them in a browser?

Thanks!

--- End Message ---
--- Begin Message ---
Hugh Beaumont <[EMAIL PROTECTED]> wrote:
<quote -------------------------------------------------------------------->

I've been working with

error_reporting(E_ALL)

set lately trying to write code that does not give notices or errors.





What is the proper way to set a variable so that it's non-existance


will not generate

a notice?




Thanks all for the replies. I also noticed a small typo in the code I posted which made it even
worse (used == instead of = when doing the assignment).


<quote -------------------------------------------------------------------->

There's a book called XX number of ways to improve your C++ code. Well, it works on 
lots of languages. About equality statements? Put the constant on the left, then it's 
not accidentally an assignement.

if( 15==$dudes_age ){ $action="Slap him if he looks at your daughter"; }

vs

if( $daughters_age==(18*365 + 4 + 1) ){ $action="Give her a box of con***s and kick her 
out"; }
//18 years, plus 4 leap days plus one day.
If you accidentally mamke the '==' a '=' in the second statement, it will always be 
true, and you will get arrested for kicking your 8 year old out into the street.

--- End Message ---
--- Begin Message ---
On 10/05/2004 12:03 PM, Marten Lehmann <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> one account of a user on our webserver was compromised using a feature
> of fopen to load external sources. As of the documentation, there shall
> be a configure option called "--disable-url-fopen-wrapper".
> Unfortunately, this option doesn't seem to exist in 4.3.9. How can I set
> a default for allow_url_fopen during the compilation? Or is the only way
> to set
> 
> allow_url_fopen=0
> 
> in the master php.ini?

As of PHP 4.3.5, I believe the only way to change allow_url_fopen is via
php.ini or httpd.conf. AFAICT, --disable-url-fopen-wrapper disappeared in
PHP 4.0.4.

Paul

--- End Message ---
--- Begin Message ---
Hi

I have a strange problem that I can not figure out how to solve ..

I'm trying to save some data into a regular mySQL database table by using a
normal php
insertion script but I'm trying to save "Arabic Text" and here comes the
problem ..

When I'm performing the insertion by writing the actual text directly into
the insert SQL statement
the insertion performed well, and I can view the data again correctly.

But when I'm performing the insertion by passing variables to the insertion
SQL statement, the text
does not get saved correctly and when I try to view the saved data I see
garbage instead.


(I was using the same table for both cases)

Thanks in advance

--- End Message ---
--- Begin Message --- Dre wrote:
Hi

I have a strange problem that I can not figure out how to solve ..

I'm trying to save some data into a regular mySQL database table by using a
normal php
insertion script but I'm trying to save "Arabic Text" and here comes the
problem ..

When I'm performing the insertion by writing the actual text directly into
the insert SQL statement
the insertion performed well, and I can view the data again correctly.

But when I'm performing the insertion by passing variables to the insertion
SQL statement, the text
does not get saved correctly and when I try to view the saved data I see
garbage instead.

Is the variable comming from a html form? You might have different encoding in your text editor and in html page.

--- End Message ---
--- Begin Message ---
the variables I'm using are sent correctly from the html form to the page
contains the insertion script .. and both of these pages has the same
encoding


"Dre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> I have a strange problem that I can not figure out how to solve ..
>
> I'm trying to save some data into a regular mySQL database table by using
a
> normal php
> insertion script but I'm trying to save "Arabic Text" and here comes the
> problem ..
>
> When I'm performing the insertion by writing the actual text directly into
> the insert SQL statement
> the insertion performed well, and I can view the data again correctly.
>
> But when I'm performing the insertion by passing variables to the
insertion
> SQL statement, the text
> does not get saved correctly and when I try to view the saved data I see
> garbage instead.
>
>
> (I was using the same table for both cases)
>
> Thanks in advance

--- End Message ---
--- Begin Message ---
Perhaps you fixed things but they all appeared to work for me (at least
mostly).

https://celestica.tristarpromotions.com/NEW/index3.php

This last one, seemed to not do the mouseout on the "contact" button, but
all three seemed to work.

Good job,

Warren Vail


-----Original Message-----
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 05, 2004 8:20 PM
To: 'PHP Mailing Lists'
Subject: Re: [PHP] why this doesn't work as an external file but does
internally?


Aaron Wolski wrote:
> Ok.. here are 3 links:
> 
> https://celestica.tristarpromotions.com/NEW/index2.php
> 
> This link... you'll see that the rollover effects on the top menu 
> work. The external JS file (called: jsstuffnew.php) has code that 
> looks like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/home_on.gif";
> 
> https://celestica.tristarpromotions.com/NEW/index.php
> 
> This link... you'll see that the rollover effects on the top menu DO 
> NOT work. The external JS file (called: jsstuff.php) has code that 
> looks
> like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/<?php echo $img_home_on; ?>";
> 
> As you can see, the difference between the two is the fact that the 
> image FILE NAME is hard coded into the file as opposed to calling.
> 
> 
> https://celestica.tristarpromotions.com/NEW/index3.php
> 
> This link... you'll see that the rollover effects work as well. 
> Instead of having an external file I have embedded the JS code 
> directly into the page.
> 
> Additionally, I have use code that looks like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/<?php echo $img_home_on; ?>";
> 
> 
> Having visuals... does that help communicate what the problem is?

Yes, the output of your JavaScript in the second example is missing 
$img_home_on (it's outputting nothing).  Where does this variable get 
set?  How about posting the php code for 
https://celestica.tristarpromotions.com/NEW/jsstuff.php


-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

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

--- End Message ---
--- Begin Message ---
Does anyone know how I might be able to have php push a file to an FTP 
server?

Thanks,

Aaron 

--- End Message ---
--- Begin Message --- Aaron Todd wrote:
Does anyone know how I might be able to have php push a file to an FTP server?


If you configure PHP with --enable-ftp, you'll have a bunch of FTP functions at your disposal, including PUT:

    http://ca.php.net/ftp

--
Aaron Gould
Parts Canada - Web Developer

--- End Message ---
--- Begin Message ---
> Does anyone know how I might be able to have php push a file to an FTP
> server?

did you look in the manual or even try google?

http://us4.php.net/ftp

--- End Message ---
--- Begin Message --- Aaron Todd wrote:
Does anyone know how I might be able to have php push a file to an FTP server?

Thanks,

Aaron


http://us4.php.net/ftp

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi All,

Just wanted to thank everyone for their advice and help.

What I ended up doing is simply doing an include() of the JS code
instead of externally linking to the file.

This works perfectly.

Thanks again everyone! I appreciate it.

Regards,

Aaron

> -----Original Message-----
> From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> Sent: October 5, 2004 4:51 PM
> To: 'John Nichel'; 'PHP Mailing Lists'
> Subject: RE: [PHP] why this doesn't work as an external file but does
> internally?
> 
> 
> 
> > -----Original Message-----
> > From: John Nichel [mailto:[EMAIL PROTECTED]
> > Sent: October 5, 2004 4:06 PM
> > To: PHP Mailing Lists
> > Subject: Re: [PHP] why this doesn't work as an external file but
does
> > internally?
> >
> > Please reply to the list, and not just an individual person.
> >
> > No.  I turn my radio on, but it doesn't work, what's the problem?
See
> > what I mean?  The question doesn't supply enough information to make
> an
> > educated guess as to what the problem may be.
> >
> > What error messages are produced?
> > What does the remotely included file output?
> > Does the second variable have value?
> > Can you provide a link to where we can see the issue at play?
> > So on, and so forth.
> >
> > Look at the source of your page that "doesn't work", where the JS is
> > supposed to be, and chances are, you'll see the problem.
> 
> Ok.. here are 3 links:
> 
> https://celestica.tristarpromotions.com/NEW/index2.php
> 
> This link... you'll see that the rollover effects on the top menu
work.
> The external JS file (called: jsstuffnew.php) has code that looks
like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/home_on.gif";
> 
> https://celestica.tristarpromotions.com/NEW/index.php
> 
> This link... you'll see that the rollover effects on the top menu DO
NOT
> work. The external JS file (called: jsstuff.php) has code that looks
> like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/<?php echo $img_home_on; ?>";
> 
> As you can see, the difference between the two is the fact that the
> image FILE NAME is hard coded into the file as opposed to calling.
> 
> 
> https://celestica.tristarpromotions.com/NEW/index3.php
> 
> This link... you'll see that the rollover effects work as well.
Instead
> of having an external file I have embedded the JS code directly into
the
> page.
> 
> Additionally, I have use code that looks like:
> 
> img1on = new Image();   img1on.src = "<?php echo $base_url;
> ?>Graphics/<?php echo $img_home_on; ?>";
> 
> 
> Having visuals... does that help communicate what the problem is?
> 
> In terms of what errors I am seeing, etc... I cannot tell you that
> because NO errors come up at all, even with the external pages.
> 
> Thanks John. Hope I explained it a bit better this time around.
> 
> Regards,
> 
> Aaron
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Those of us that view emails as a list of conversations would
appreciate not changing subject lines.


On Wed, 6 Oct 2004 16:01:32 -0400, Aaron Wolski <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> Just wanted to thank everyone for their advice and help.
> 
> What I ended up doing is simply doing an include() of the JS code
> instead of externally linking to the file.
> 
> This works perfectly.
> 
> Thanks again everyone! I appreciate it.
> 
> Regards,
> 
> Aaron
> 
> > -----Original Message-----
> > From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> > Sent: October 5, 2004 4:51 PM
> > To: 'John Nichel'; 'PHP Mailing Lists'
> > Subject: RE: [PHP] why this doesn't work as an external file but does
> > internally?
> >
> >
> >
> > > -----Original Message-----
> > > From: John Nichel [mailto:[EMAIL PROTECTED]
> > > Sent: October 5, 2004 4:06 PM
> > > To: PHP Mailing Lists
> > > Subject: Re: [PHP] why this doesn't work as an external file but
> does
> > > internally?
> > >
> > > Please reply to the list, and not just an individual person.
> > >
> > > No.  I turn my radio on, but it doesn't work, what's the problem?
> See
> > > what I mean?  The question doesn't supply enough information to make
> > an
> > > educated guess as to what the problem may be.
> > >
> > > What error messages are produced?
> > > What does the remotely included file output?
> > > Does the second variable have value?
> > > Can you provide a link to where we can see the issue at play?
> > > So on, and so forth.
> > >
> > > Look at the source of your page that "doesn't work", where the JS is
> > > supposed to be, and chances are, you'll see the problem.
> >
> > Ok.. here are 3 links:
> >
> > https://celestica.tristarpromotions.com/NEW/index2.php
> >
> > This link... you'll see that the rollover effects on the top menu
> work.
> > The external JS file (called: jsstuffnew.php) has code that looks
> like:
> >
> > img1on = new Image();   img1on.src = "<?php echo $base_url;
> > ?>Graphics/home_on.gif";
> >
> > https://celestica.tristarpromotions.com/NEW/index.php
> >
> > This link... you'll see that the rollover effects on the top menu DO
> NOT
> > work. The external JS file (called: jsstuff.php) has code that looks
> > like:
> >
> > img1on = new Image();   img1on.src = "<?php echo $base_url;
> > ?>Graphics/<?php echo $img_home_on; ?>";
> >
> > As you can see, the difference between the two is the fact that the
> > image FILE NAME is hard coded into the file as opposed to calling.
> >
> >
> > https://celestica.tristarpromotions.com/NEW/index3.php
> >
> > This link... you'll see that the rollover effects work as well.
> Instead
> > of having an external file I have embedded the JS code directly into
> the
> > page.
> >
> > Additionally, I have use code that looks like:
> >
> > img1on = new Image();   img1on.src = "<?php echo $base_url;
> > ?>Graphics/<?php echo $img_home_on; ?>";
> >
> >
> > Having visuals... does that help communicate what the problem is?
> >
> > In terms of what errors I am seeing, etc... I cannot tell you that
> > because NO errors come up at all, even with the external pages.
> >
> > Thanks John. Hope I explained it a bit better this time around.
> >
> > Regards,
> >
> > Aaron
> >
> > --
> > 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
> 
>

--- End Message ---
--- Begin Message --- Brian wrote:
Those of us that view emails as a list of conversations would
appreciate not changing subject lines.

Changing the subject line as in putting 'SOLVED' in it? Hell, I wish more people did that.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- i know this isn't completely related to php but i am creating a web based news reader in php, how much disk space do you think i need to run my own local news server?
--- End Message ---
--- Begin Message ---
[snip]
i know this isn't completely related to php but i am creating a web
based 
news reader in php, how much disk space do you think i need to run my
own 
local news server?
[/snip]

I'd go with a 1TB RAID

--- End Message ---
--- Begin Message --- Jay Blanchard is quoted as saying on 10/6/2004 4:49 PM:
[snip]
i know this isn't completely related to php but i am creating a web
based news reader in php, how much disk space do you think i need to run my
own local news server?
[/snip]


I'd go with a 1TB RAID


Only 1TB??

--- End Message ---
--- Begin Message ---
> [snip]
> i know this isn't completely related to php but i am creating a web
> based
> news reader in php, how much disk space do you think i need to run my
> own
> local news server?
> [/snip]
>
> I'd go with a 1TB RAID
>

Better go with 2TB. You know how all that porn fills up.

-- 
--Matthew Sims
--<http://killermookie.org>

--- End Message ---
--- Begin Message ---
[snip]
Better go with 2TB. You know how all that porn fills up.
[/snip]

Shoot, I forgot porn. 4-7TB minimum....

--- End Message ---
--- Begin Message --- Your first scenario can been done in a similar fashion to how you are used to doing it in SQL:

if ( in_array($a, array(1,4,20,...) ) {}

Your second scenario doesn't seem like there is much of a problem because it will always be short (can only have 2 comparisons).

-Shawn


Jay Blanchard wrote:
[snip]
I'm sure I'll be flamed for this, but it seems to me that there should
be a
shortcut way to write:

If ($a == 1 || $a == 4 || $a == 20 || ...) {}

To something more like what SQL has...

If ( $a IN(1,4,20,...) ) {}

And same with the very helpful SQL BETWEEN 'function'.

Instead of

If ($a > 1 && $a < 20) {}

Why not

If ($a BETWEEN (1,20)) {}
[/snip]


You could write a function and share it with the rest of us!

--- End Message ---
--- Begin Message ---
> On Friday 01 October 2004 05:52, Ed Lazor wrote:
> > Images take up more space when stored in the db, because you're storing
> raw
> > binary data.  Gif and jpeg are compression methods that convert binary
> data
> > into something smaller that can be stored in a file.
> 
> ??
> 
> If you store a jpeg file into a database blob, the database doesn't
> magically
> decompress the jpeg file. It will just treat the jpeg file as any other
> binary file and store it as-is (plus any overhead).

Sorry for not responding sooner - just found this message while cleaning on
my PHP folder.

Anyway, we're both right, depending on how you go about saving the images to
the database.  You're talking about using PHP's file functions to open the
image file, read in the data, and stream it to the database.  I'm talking
about using the built-in GD functions to grab the image (like
imagecreatefromjpeg) and store it into the database.

As you're pointing out, the GD functions are performing the compression and
decompression.

This was part of another discussion GH and I were having on the MySQL list
about different approaches to storing large collections of images.  Sorry, I
should have mentioned that.

-Ed

--- End Message ---
--- Begin Message ---
No problem Ed thanks...

Actually I was supprised to see this conversation (thread) come back
into my GMAIL inbox....


On Wed, 6 Oct 2004 15:57:12 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote:
> > On Friday 01 October 2004 05:52, Ed Lazor wrote:
> > > Images take up more space when stored in the db, because you're storing
> > raw
> > > binary data.  Gif and jpeg are compression methods that convert binary
> > data
> > > into something smaller that can be stored in a file.
> >
> > ??
> >
> > If you store a jpeg file into a database blob, the database doesn't
> > magically
> > decompress the jpeg file. It will just treat the jpeg file as any other
> > binary file and store it as-is (plus any overhead).
> 
> Sorry for not responding sooner - just found this message while cleaning on
> my PHP folder.
> 
> Anyway, we're both right, depending on how you go about saving the images to
> the database.  You're talking about using PHP's file functions to open the
> image file, read in the data, and stream it to the database.  I'm talking
> about using the built-in GD functions to grab the image (like
> imagecreatefromjpeg) and store it into the database.
> 
> As you're pointing out, the GD functions are performing the compression and
> decompression.
> 
> This was part of another discussion GH and I were having on the MySQL list
> about different approaches to storing large collections of images.  Sorry, I
> should have mentioned that.
> 
> -Ed
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
Hi!
I have a trouble with building MySQL and MySQLi support together with PHP... 
Basically my config says:

../configure --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config  (and other 
switches)
but I get this:

/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): multiple definition of 
`net_buffer_length'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple definition of 
`max_allowed_packet'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first defined here

and that for basically for each function....
Anyone knows, how to make the mysqli and mysql extension work together?

Thanks. Stormy.

--- End Message ---
--- Begin Message ---
http://bugs.php.net/bug.php?id=29860

Whitehawk Stormchaser wrote:
Hi!
I have a trouble with building MySQL and MySQLi support together with PHP... Basically my config says:


../configure --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config (and other switches)
but I get this:


/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): multiple definition of `net_buffer_length'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple definition of `max_allowed_packet'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first defined here


and that for basically for each function....
Anyone knows, how to make the mysqli and mysql extension work together?

Thanks. Stormy.


--- End Message ---
--- Begin Message ---
"John Swartzentruber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 10/3/2004 4:02 PM Matthew Fonda wrote:
> > Howdy,
> >
> > I noticed that quite a few people were having a hard time installing PHP
> > on Fedora Core or Redhat, so I put together a little tutorial explaining
> > how to do it. Hope it helps :D
> > http://mfonda.dotgeek.org/fcrh.php
>
> I'm not complaining about any tutorials, but this doesn't quite fit
> with my experience. I installed FC2 (not an upgrade). I then ran
> phpinfo() to get the configure options for the installed PHP. I used
> those options to configure PHP5. After running make and make install,
> I edited "/etc/httpd/conf.d/php.ini" to change the LoadModule line.

does your installation have apxs? mine doesn't even though phpinfo says that
(the fedora installed) php4 was configured with it.

>
> I believe I also needed to remove the domxml.ini file from /etc/php.d.
> I may have also needed to more some other files around.
>
> My point isn't to provide another tutorial, but to say that a PHP and
> linux newbie (me) can install PHP5 without also installing Apache. I
> am inexperienced with Apache and PHP, so I'm not claiming it is
> *better* not to re-install Apache, just that it isn't necessary under FC2.

--- End Message ---

Reply via email to