Re: [PHP] strcmp()?

2011-05-23 Thread Alexey Bovanenko
I checked on php 5.2.4-2 (ubuntu5.12). It returns 1,-1,1

On Mon, May 23, 2011 at 4:00 PM, tedd  wrote:

> At 8:13 AM + 5/23/11, Ford, Mike wrote:
>
>>  > -Original Message-
>>  > From: tedd [mailto:tedd.sperl...@gmail.com]
>>  > >On Sat, 21 May 2011 09:26:02 -0400, tedd wrote:
>>  > >>  The function strcmp() simply evaluates two strings and reports
>>  > back -1, 0, or 1 depending upon their  alphabetical relationship.
>>  > >
>>
>>>  >It might do that, but don't bet your horse on it.
>>>  >
>>>  >
>>>  >
>>>
>>  > >/Nisse
>>
>>>
>>>  It works that way for me.
>>>
>>
>> Are you absolutely certain about that?
>>
>>   echo strcmp('These are nearly equal', 'These are almost equal'), "\n";
>>   echo strcmp('different', 'unequal'), "\n";
>>   echo strcmp('b', 'a'), "\n";
>>
>> Result:
>>
>>   13
>>   -17
>>   1
>>
>> The description of the function merely says that the result is <0, 0 or >0
>> -- it makes no promises about the actual value when it is non-zero.
>>
>> Mike
>>
>
> Mike:
>
> That's interesting. Try the same comparisons here:
>
> http://www.webbytedd.com/lcc/citw229/string-compare.php
>
> For me they are 1, -1, and 1.
>
> Someone with more smarts than me* will have to figure this one out.
>
> Cheers,
>
> tedd
>
> PS: * I can hear the peanut gallery saying "That won't be hard."  :-)
>
> --
> ---
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
With regards,
Alexei Bovanenko


Re: [PHP] Mail Function Problem

2010-04-12 Thread Alexey Bovanenko
Hi!

You have the following php.ini params:
SMTP = smtp.live.com
smtp_port = 587

live.com not support relay and it requires authentication.


On Mon, Apr 12, 2010 at 6:33 AM, Alice Wei  wrote:

>
> Hi,
>
> I have an issue here where I see no PHP errors on my mail function usage,
> and yet I am not getting the mail in the desired account. Here is what I
> have for my PHP code:
>
> $headers = "From: aj...@alumni.iu.edu";
> $to = "aj...@alumni.iu.edu ";
> $subject = "Comments Regarding My Studio";
> $body = "From: $your_name\n E-Mail: $email\n Reason Contact: $question\n
> Comments:\n $comments";
> mail($to, $subject, $body,$headers);
>
> This is what I have in my PHP.ini:
>
> [mail function]
> ; For Win32 only.
> SMTP = smtp.live.com
> smtp_port = 587
>
> ; For Win32 only.
> sendmail_from = aj...@alumni.iu.edu
>
> ; For Unix only.  You may supply arguments as well (default: "sendmail -t
> -i").
> ;sendmail_path =
>
> ; Force the addition of the specified parameters to be passed as extra
> parameters
> ; to the sendmail binary. These parameters will always replace the value of
> ; the 5th parameter to mail(), even in safe mode.
> ;mail.force_extra_parameters =
>
> Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can anyone on
> the list please give me some pointers on what I may have done wrong here?
> Thanks for your help.
>
> _
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
>
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3




-- 
With regards,
Alexei Bovanenko


Re: [PHP] MySQL query not working!

2010-03-31 Thread Alexey Bovanenko
Hi!

To view error:
you must use mysql_query(). @ before mysql - error supression.

next

you can use the following:

$result=..
if($result){
 if(mysql_num_rows($result)){
/* you have record in table */
}else{
  /* you haven't */

On Wed, Mar 31, 2010 at 4:11 PM, Andre Polykanine  wrote:

> Hello Parham,
>
> Adding to Ash's question, why to use the @ operator before
> mysql_query?
> --
> With best regards from Ukraine,
> Andre
> Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @
> jabber.org
> Yahoo! messenger: andre.polykanine; ICQ: 191749952
> Twitter: m_elensule
>
> - Original message -
> From: Parham Doustdar 
> To: php-general@lists.php.net 
> Date: Wednesday, March 31, 2010, 2:50:07 PM
> Subject: [PHP] MySQL query not working!
>
> Hi there,
> Here is a snippet of code... that doesn't work for some reason. Please note
> that I have put some
>
> @mysql_query($query) or die(mysql_error());
>
> statements, to see if MySQL gives an error. I receive nothing other than
> the
> file starting to download. This is supposed to be a file download counter:
>
> [code]
>  //connect to the DB
> mysql_connect() //There is no problem with the connection so I didn't
> include the complete code.
>
> //The table where the hits are stored.
> $table = "files";
>
> $query = "select * from " . $table . " where filename = '" . $_GET['file']
> .
> "'";
> $result = mysql_query($query);
>
> if ($result) //Has the file previously been added?
> {
> $query = "update " . $table . " set hits = hits + 1 where filename = '" .
> $_GET['file'] . "'";
> @mysql_query($query) or die(mysql_error());
> header('location:http://www.qwitter-client.net/' . $_GET['file']);
> }
> else //it's the first time we're adding this file to the DB.
> {
> $query = "insert into " . $table . " (filename, hits) values ('" .
> $_GET['file'] . "', 1)";
> @mysql_query($query) or die(mysql_error());
> header('location:http://www.qwitter-client.net/' . $_GET['file']);
> }
> ?>
>
>
>
> --
> 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
>
>


-- 
With regards,
Alexei Bovanenko