php-general Digest 28 Feb 2013 02:14:13 -0000 Issue 8140

Topics (messages 320315 through 320319):

Re: Stupid question
        320315 by: Serge Fonville
        320316 by: Ford, Mike
        320318 by: tamouse mailing lists
        320319 by: Curtis Maurand

Running several applications involving PHP on virtual private server - 
optimization possible?
        320317 by: Gary Lebowitz

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Perhaps he could share all relevant code, since at this time we are mostly
guessing.
Declaration/assignment of a lot of variables isn't included in the snippets.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/2/27 Jim Giner <jim.gi...@albanyhandball.com>

> On 2/26/2013 4:27 PM, Curtis Maurand wrote:
>
>> I have the following:
>>
>> $dsn = "mysqli://$username:$password@**$hostname2/$database";
>> $options = array(
>>      'debug' => 3,
>>      'result_buffering' => false,
>>    );
>>    $dbh =& MDB2::factory($dsn, $options);
>>          if (PEAR::isError($mdb2))
>>          {
>>                  die($mdb2->getMessage());
>>          }
>>
>>
>>
>>
>> function tallyCart($_u_id,$dbh){
>>         while($row = $result->fetchrow(MDB2_**FETCHMODE_ASSOC)) {
>>                  $_showCheckOut=1;
>>                  $_pdetail=new ProductDetail($row{'product_**ID'},
>> $row{'product_Quantity'}, $_u_id);
>>                   $_getSubTotal += $_pdetail->_subTotal;
>>                   $_counter++;
>>          }
>> }
>>
>> I'm getting:  Call to undefined method MDB2_Error::fetchrow()
>>
>> anyone have any ideas?  Can I not pass a database handle to a function?
>>
>> Thanks,
>> Curtis
>>
>>
> This may be that stupid answer, but I see what appears to be two problems.
>
> 1 - $result is not declared globally in your function header, so hence
> it's undefined, hence all of its methods are.
>
> 2 - you have a couple indices wrapped in curly braces, not parens.  Is
> that some new kind of syntax I'm not aware of?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jim Giner [mailto:jim.gi...@albanyhandball.com]
> Sent: 27 February 2013 12:28
> 
> 
> 2 - you have a couple indices wrapped in curly braces, not parens.
> Is
> that some new kind of syntax I'm not aware of?

No, that's some old kind of syntax you have no reason to be aware of :).

Curly braces as an alternative to square brackets have been deprecated for,
oooh, probably several years now...!


Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk     T: +44 113 812 4730




To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
On Wed, Feb 27, 2013 at 2:42 AM, Sebastian Krebs <krebs....@gmail.com> wrote:
> 2013/2/27 tamouse mailing lists <tamouse.li...@gmail.com>
>> Well, *I* have a stupid question: is $lhv =& expr the same as $lhv = &expr
>> ??
>
> Yes :) Because an operator "=&" doesn't exists, thus the lexer will split
> them into the tokens "= &", or "= WHITESPACE &" respectively. The parser
> again ignores whitespaces.
>

Thanks; thought I was seeing something new, and/or going nuts --
apologies for the thread hijack

--- End Message ---
--- Begin Message ---
On 2/27/2013 6:32 PM, tamouse mailing lists wrote:
On Wed, Feb 27, 2013 at 2:42 AM, Sebastian Krebs <krebs....@gmail.com> wrote:
2013/2/27 tamouse mailing lists <tamouse.li...@gmail.com>
Well, *I* have a stupid question: is $lhv =& expr the same as $lhv = &expr
??
Yes :) Because an operator "=&" doesn't exists, thus the lexer will split
them into the tokens "= &", or "= WHITESPACE &" respectively. The parser
again ignores whitespaces.

Thanks; thought I was seeing something new, and/or going nuts --
apologies for the thread hijack

Well that means the docs on the PEAR MDB2 website are incorrect and should be fixed. Thanks for the lesson.

--Curtis


--- End Message ---
--- Begin Message ---
I currently have 1 domain on a VPS with 1 instance of Moodle 2.3.2. To
minimize the danger of overtaxing the resources (I share a processor :-(
but have 2GBytes of guaranteed RAM) I was wondering if there were anything
I could do if I wanted to put, say, Wordpress or another domain on the same
server with another instance of Moodle in terms of PHP tuning. For the
moment all is well, but I prefer to avoid problems in future if possible.
Ah yes, my PHP version is 5.3.3.

--- End Message ---

Reply via email to