php-general Digest 8 May 2008 21:37:47 -0000 Issue 5448

Topics (messages 274028 through 274038):

Re: mysql query and maximum characters in sql statement
        274028 by: Sanjeev N

Re: Difference between imagegif/imagejpeg sending to browser <-> saving to file?
        274029 by: zyro

Newbie - is there a function similar to the sql 'like' comparison operator?
        274030 by: revDAVE
        274031 by: Kalle Sommer Nielsen
        274037 by: Shawn McKenzie

Setting up a program that can be accessed by all domain on a server
        274032 by: Richard Kurth
        274033 by: Dan Joseph
        274034 by: Richard Kurth
        274036 by: Dan Joseph
        274038 by: Richard Kurth

Re: Re[PHP] gex to catch <p>s
        274035 by: smulyono

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 ---
Hi Jim Lucas,

You are correct... i want to run in the same way.

but as my 2 tables, column name are different i cant run the LOAD DATA
infile.

And the example you mentioned for break at 100, also i thought to use in
that way. but one of the column had the text type which we cant predict
about the size.

Thanks for the support from all of you.

Now, I am inserting the rows one by one only


On 5/2/08, Chris <[EMAIL PROTECTED]> wrote:
>
> Jim Lucas wrote:
> > Waynn Lue wrote:
> >> Wouldn't using LOAD DATA INFILE be better than writing your own script?
> >>
> >
> > depends, does the data file match the table column for column?
>
>
> Doesn't have to.
>
> http://dev.mysql.com/doc/refman/5.0/en/load-data.html
>
> By default, when no column list is provided at the end of the LOAD DATA
> INFILE statement, input lines are expected to contain a field for each
> table column. If you want to load only some of a table's columns,
> specify a column list:
>
> LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata (col1,col2,...);
>
>
> But load data infile requires extra mysql privileges.
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>



-- 
Regards,
Sanjeev
http://www.sanchanworld.com | http://webdirectory.sanchanworld.com - submit
your site

--- End Message ---
--- Begin Message ---
Lo again,

found my mistake.. in fact, it was the hex-to-rgb conversion not working
properly in some cases.

[SUBJECT CLOSED]


zyro wrote:
> 
> Hello together,
> 
> I stumbled onto a curious problem:
> i am generating a jpeg/gif with the imagejpeg/imagegif functions (type
> does not alter the result).
> 
> Example color "#ff0000": The hexToRGB coversion etc is all working fine.
> The image (if its send directly to the browser via header and
> imagegif/imagejpeg) is displayed 100% correctly.
> But if i save it to a file on the servers file system, the red above gets
> lime green. And not only those two colors are bugged: It looks like the
> whole palette gets scrambled up ???
> 
> So my question: Is there a-n-y difference between sending and saving the
> image?
> Or do I have to do some additional work before an image can be saved
> correctly? php func reference says something about using
> imagecolortransparent() on the image first to achieve the 89a format (in
> case of gif) but again: This does not alter the result either. Also,
> transparency is not needed at this point but used in images that are
> merged (gifs) to achieve the final result.
> 
> Another interesting point:
> - generated image sent to browser, properties: ~3kb
> - generated image, saved in filesys, properties: ~15kb
> What explains that diff in filesize?
> 
> Thanks for your help,
> 
> greets,
> 
> zyro
> 

-- 
View this message in context: 
http://www.nabble.com/Difference-between-imagegif-imagejpeg-sending-to-browser-%3C-%3E-saving-to-file--tp17078670p17123492.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
Newbie - is there a function similar to the sql 'like' comparison operator?

I would like to be able to compare 2 strings:

If $this ---*like or similar to*--- $that

That type of thing...


I know of this page:

http://us3.php.net/manual/sl/language.operators.comparison.php


But I don't see something 'like' or 'similar' to something else


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists]




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

Theres the similar_text() function which calculates the procentage of te similarity between
two strings.

If your looking for a check to see if a string has some specified text then use the strpos() function and then the identical comparison operator to check for true and false


Kalle Sommer Nielsen
DR - www.dr.dk

----- Original Message ----- From: "revDAVE" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, May 08, 2008 5:20 PM
Subject: [PHP] Newbie - is there a function similar to the sql 'like' comparison operator?


Newbie - is there a function similar to the sql 'like' comparison operator?

I would like to be able to compare 2 strings:

If $this ---*like or similar to*--- $that

That type of thing...


I know of this page:

http://us3.php.net/manual/sl/language.operators.comparison.php


But I don't see something 'like' or 'similar' to something else


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists]




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





--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.10/1421 - Release Date: 07-05-2008 17:23




--- End Message ---
--- Begin Message ---
revDAVE wrote:
Newbie - is there a function similar to the sql 'like' comparison operator?

I would like to be able to compare 2 strings:

If $this ---*like or similar to*--- $that

That type of thing...


I know of this page:

http://us3.php.net/manual/sl/language.operators.comparison.php


But I don't see something 'like' or 'similar' to something else


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists]



Probably the most similar that allows some wildcards (pattern matching) is ereg(). You have more power in that you can control what must match and how much.

In MySQL 'a' = ' a ' is true but 'a' LIKE ' a ' is false. So you need to use the wildcard % to match anything ' xxaxx ' LIKE '%a%' is true or _ to match one character ' a ' LIKE '_a_' is true.

The problem with similar_text() is that it gives you a percentage of similarity which may be misleading unless you also figure in the return of how many chars match. For example similar_text('CAT', 'CA', &$p) $p would be 66.6%, is that like or not?

-Shawn

--- End Message ---
--- Begin Message --- I have a program that I am writing that I what to install on my server that can be accessed by all domains on the server just like it was on there domain. Could somebody give me an idea on how I can do this or point me to some article that tells how to set this up.
--- End Message ---
--- Begin Message ---
On Thu, May 8, 2008 at 11:47 AM, Richard Kurth <[EMAIL PROTECTED]>
wrote:

> I have a program that I am writing that I what to install on my server that
> can be accessed by all domains on the server just like it was on there
> domain. Could somebody give me an idea on how I can do this or point me to
> some article that tells how to set this up.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Accessible as in able to talk to it and pull information, or be able to
integrate it into the web site?  If its just needing to get data, you could
build a web service and give access to it for all other domains.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month. Reseller plans and
Dedicated servers available.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

--- End Message ---
--- Begin Message ---
Dan Joseph wrote:
On Thu, May 8, 2008 at 11:47 AM, Richard Kurth <[EMAIL PROTECTED]>
wrote:

I have a program that I am writing that I what to install on my server that
can be accessed by all domains on the server just like it was on there
domain. Could somebody give me an idea on how I can do this or point me to
some article that tells how to set this up.

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



Accessible as in able to talk to it and pull information, or be able to
integrate it into the web site?  If its just needing to get data, you could
build a web service and give access to it for all other domains.
To Be able to integrate it into the web site is what I am trying to figure out


--- End Message ---
--- Begin Message ---
On Thu, May 8, 2008 at 11:54 AM, Richard Kurth <[EMAIL PROTECTED]>
wrote:

> Dan Joseph wrote:
>
>> On Thu, May 8, 2008 at 11:47 AM, Richard Kurth <
>> [EMAIL PROTECTED]>
>> wrote:
>>
>>
>>
>>> I have a program that I am writing that I what to install on my server
>>> that
>>> can be accessed by all domains on the server just like it was on there
>>> domain. Could somebody give me an idea on how I can do this or point me
>>> to
>>> some article that tells how to set this up.
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>> Accessible as in able to talk to it and pull information, or be able to
>> integrate it into the web site?  If its just needing to get data, you
>> could
>> build a web service and give access to it for all other domains.
>>
>>
> To Be able to integrate it into the web site is what I am trying to figure
> out
>
>
You should be able to configure Apache (assuming you're using Apache) in a
way that for instance:  http://domain.com/globalapplication/ would be
pointing to a specified folder.  You would just have to tell it to make that
path for all domains on the server.  Although that might be better suited
for someone on an Apache list or forum to explain better.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month. Reseller plans and
Dedicated servers available.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

--- End Message ---
--- Begin Message ---
Dan Joseph wrote:
On Thu, May 8, 2008 at 11:54 AM, Richard Kurth <[EMAIL PROTECTED]>
wrote:

Dan Joseph wrote:

On Thu, May 8, 2008 at 11:47 AM, Richard Kurth <
[EMAIL PROTECTED]>
wrote:



I have a program that I am writing that I what to install on my server
that
can be accessed by all domains on the server just like it was on there
domain. Could somebody give me an idea on how I can do this or point me
to
some article that tells how to set this up.

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




Accessible as in able to talk to it and pull information, or be able to
integrate it into the web site?  If its just needing to get data, you
could
build a web service and give access to it for all other domains.


To Be able to integrate it into the web site is what I am trying to figure
out


You should be able to configure Apache (assuming you're using Apache) in a
way that for instance:  http://domain.com/globalapplication/ would be
pointing to a specified folder.  You would just have to tell it to make that
path for all domains on the server.  Although that might be better suited
for someone on an Apache list or forum to explain better.

Thanks that is what I needed to know I will now check on an apache list

--- End Message ---
--- Begin Message ---
If you mean <p class='something'></p> then this should be okay:

$tag_regex=array(
  '/\<p\>(.*?)\<\/p\> /si' => "$1",
  '/\<p(\s*)class\=(*.?)\>(.*?)\<\/p\>/si' => "$2"
);
$paragraphs=preg_replace(array_keys($tag_regex),array_values($tag_regex),$pa
ge);

$paragraphs will be the return value 
$page is the text with all of the tags that you want to stripped

If you want, you can try the first value in the array first which detect the
<p></p>. I didn't test this, but this should be working since I also use
this kind of way to revert the phpbb code into HTML.

HTH,

Thanks,


-----Original Message-----
From: Ryan S [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 07, 2008 10:52 AM
To: vester_s
Cc: php php
Subject: Re: [PHP] Re: Re[PHP] gex to catch <p>s



 
Hey,

<clip>
$tag_regex=array(
  '/\<p(\s*)\>(.*?)\<\/p\> /si' => "$1",
  '/\<(\s*)(*.?)class\=(*.?)\>(.*?)\<\/(*.?)\>/si' => "$3"
);

$paragraphs=preg_replace(array_keys($tag_regex),array_values($tag_regex),$pa
ge);

I am not sure what tag is that you mean on <class="something">, but in this
RE .. it should capture any <p> tags (the first element of the array) and
any tags (the second element of the array) that has attribute class on it. 
 </clip>

Thanks for replying!
Sorry, a bit of a typo there, i meant <p class="something">

I ran your regex but got this warning:
Warning:  preg_replace() [function.preg-replace]: Compilation failed:
nothing to repeat at offset 8 in C:\xampp2\htdocs\ezee\tests\para_regex.php
on line 25


I think I ran it wrong, because although i have passed $page i dont know
where to pass the replacement texts...

Can you give me an example on how to run this or an explanation?

Thanks!
R



 
____________________________________________________________________________
________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--- End Message ---

Reply via email to