php-general Digest 15 Sep 2009 13:51:58 -0000 Issue 6341

Topics (messages 298056 through 298066):

Re: APC - Upload progress problem. apc
        298056 by: Nathan Nobbe
        298059 by: Phred White
        298066 by: Nathan Nobbe

Re: Creating alphanumeric id for a table
        298057 by: aveev
        298058 by: Ben Dunlap

Re: PHP GURU NEEDED
        298060 by: Jerome Botbol

anyone interested in PHP? Call for moderator
        298061 by: Patrick
        298062 by: Ashley Sheridan
        298063 by: Yeti
        298064 by: Richard Heyes
        298065 by: Ashley Sheridan

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 ---
On Mon, Sep 14, 2009 at 4:50 PM, Phred White <[email protected]>wrote:

> Andrea:
>
> I have in my php.ini:
>
> apc.rfc1867 = On
> apc.rfc1867_freq = 10K
>
> The apc.php diagnostic/report page says it is on. It just returns false. I
> will look at your zip file and see if something jumps out.
>

what about your other apc.rfc1867 settings?

are you posting the correct field to the server to tell apc to start
tracking, and also are you grabbing the correct value when trying to
determine the status in your progress tracking script?

by default, your form needs an input like,

<input type="hidden" name="APC_UPLOAD_PROGRESS"
       id="progress_key"  value="<?php echo $id?>"/>


then in the progress checking script you will need something like,

<?php
if(isset($_GET['progress_key'])) {

  $status = apc_fetch('upload_'.$_GET['progress_key']);
  echo $status['current']/$status['total']*100;

}
?>


the names of these variables depend upon apc.rfc1867_name
and apc.rfc1867_prefix respectively.  take a look at this article, it was
really helpful,

http://www.ibm.com/developerworks/opensource/library/os-php-v525/

also, to get going fast, dont bother w/ the progress script yet.  just focus
on getting apc to start tracking the progress.  you can use the stock
apc.php script from the distro and upload a large file; this will give you
time to check in apc.php.

-nathan

--- End Message ---
--- Begin Message ---
Folks:
Thanks for all your help and suggestions.

Miracle of miracles I am now getting a response,so I can start some level of debugging.

I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size.

Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff.

Anyway now I can move forward.

Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion.

Your, phred

On Sep 14, 2009, at 8:33 PM, Nathan Nobbe wrote:

On Mon, Sep 14, 2009 at 4:50 PM, Phred White <[email protected]>wrote:

Andrea:

I have in my php.ini:

apc.rfc1867 = On
apc.rfc1867_freq = 10K

The apc.php diagnostic/report page says it is on. It just returns false. I
will look at your zip file and see if something jumps out.


what about your other apc.rfc1867 settings?

are you posting the correct field to the server to tell apc to start
tracking, and also are you grabbing the correct value when trying to
determine the status in your progress tracking script?

by default, your form needs an input like,

<input type="hidden" name="APC_UPLOAD_PROGRESS"
      id="progress_key"  value="<?php echo $id?>"/>


then in the progress checking script you will need something like,

<?php
if(isset($_GET['progress_key'])) {

 $status = apc_fetch('upload_'.$_GET['progress_key']);
 echo $status['current']/$status['total']*100;

}
?>


the names of these variables depend upon apc.rfc1867_name
and apc.rfc1867_prefix respectively. take a look at this article, it was
really helpful,

http://www.ibm.com/developerworks/opensource/library/os-php-v525/

also, to get going fast, dont bother w/ the progress script yet. just focus
on getting apc to start tracking the progress.  you can use the stock
apc.php script from the distro and upload a large file; this will give you
time to check in apc.php.

-nathan


--- End Message ---
--- Begin Message ---
On Tue, Sep 15, 2009 at 12:05 AM, Phred White <[email protected]>wrote:

> Folks:
> Thanks for all your help and suggestions.
>
> Miracle of miracles I am now getting a response,so I can start some level
> of debugging.
>
> I am not sure exactly what has been going on. I NEVER got a response, then
> I did - when I tried uploading some different files. It seems that larger
> files always give a negative response for me. Now I am thinking that it has
> been a timing issue. My ajax stuff doesn't repeat yet, so there is currently
> only one request. It seems that if the file is a little too large, the first
> response is always false, that may be the case for very small files too. I
> finally just picked a file that was the right size.
>
> Since I could never verify that APC was responding, it didn't occur to me
> to go ahead and iron out the ajax stuff.
>
> Anyway now I can move forward.
>
> Thanks all for all your suggestions, sorry this ends up being such a stupid
> conclusion.
>

good work pushing through it phred!  it was a pain in the ass when i
implemented it a few weeks back as well, so lets just assume thats how it is
for everyone ;)

-nathan

--- End Message ---
--- Begin Message ---
If I follow you correctly, is the scenario below possible.??
Let's say there are 2 users accessing the app at the same time (user A and
B). Here's the sequnce of operation...
1. user A insert into table (get id = 1 from auto increment value)
2. user B insert into table (get id = 2 from auto increment value)
3. user A get value from $id = LAST_INSERT_ID() (id = 2)
4. user B get value from $id = LAST_INSERT_ID() (id =2)
5. user A update table where id = 2
6. user B update table where id = 2

in the scenario above, the row with id = 1 doesn't get his file number (fin)
while the row with id = 2 gets the value for his file number twice...

How can we make sure that those 3 processes are atomic operation (insert
table -> get id from LAST_INSERT_ID() -> update table) ??

Thanks..


tedd-2 wrote:
> 
> For example, I would use (not tested):
> 
> // code to create a record (i.e., INSERT INTO your_table (whatever) 
> VALUES ('$whatever') )
> 
> $id = LAST_INSERT_ID();
> 
> The above statement finds the last record added to the database (the 
> index of the record) and then I would create my application-number 
> and store it in that record -- like so:
> 
> // code to create the application-number (i.e., $application-number = 
> 'AAA' . $id; )
> 
> $query = "UPDATE your_table SET application_number = 
> '$application_number' WHERE id = '$id' ";
> $result  = mysql_query($query) or die('Error, query failed');
> 
> That way you should not have any duplications and you have 
> application-numbers (as you want )that are tied to the auto-numbering 
> of the table's index.
> 
> HTH's
> 
> tedd
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-alphanumeric-id-for-a-table-tp25391939p25447945.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
> 1. user A insert into table (get id = 1 from auto increment value)
> 2. user B insert into table (get id = 2 from auto increment value)
> 3. user A get value from $id = LAST_INSERT_ID() (id = 2)
> 4. user B get value from $id = LAST_INSERT_ID() (id =2)
[8<]
> How can we make sure that those 3 processes are atomic operation (insert
> table -> get id from LAST_INSERT_ID() -> update table) ??

>From the MySQL 5.0 manual (20.9.10.3):

For LAST_INSERT_ID(), the most recently generated ID is maintained in
the server on a per-connection basis. It is not changed by another
client. ... Using LAST_INSERT_ID() and AUTO_INCREMENT columns
simultaneously from multiple clients is perfectly valid. Each client
will receive the last inserted ID for the last statement /that/ client
executed.

http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html

Ben

--- End Message ---
--- Begin Message ---
To start with I am not a recruiter just looking for talented PHP
developers to join my team.

Secondly I am trying to understand why you (Daevid) think that it is
acceptable to try and tarnish the name of my company when you don't even
know us or the work that we produce. One wonders why, if you are so
disinterested in working with us, you bothered to reply at all. As
you've already made up your mind that Cyber-Duck is not a great company
to work for this seems to be an awfully large waste of your time. 

I'm not going to spend hours going into the finer details of our
business strategy with someone whose sole purpose in answering my
initial email is to defame both myself and the company I work for.
Cyber-Duck has an exemplary track record, backed up by a host of digital
media awards and satisfied clients, none of whom have ever been put off
by the name of the company or the highly proficient flash animations on
our website. 

Thanks for the advice on buzzwords- obviously all non net-savvy
potential clients want to spend hours trying to digest page after page
of what, to them, are incomprehensible pseudonyms and abbreviations. 

Jealousy is an unattractive quality Daevid. 

-----Original Message-----
From: Daevid Vincent [mailto:[email protected]] 
Sent: 14 September 2009 22:53
To: [email protected]
Cc: Jerome Botbol
Subject: RE: [PHP] PHP GURU NEEDED

I'm not trolling, but I am really curious who and why someone thought
"Cyber-Duck" was a good name (and theme) to use?!? Seriously? 

Personally, I wouldn't work for a company with such a silly name. Is
there
some hidden meaning or is this a personal joke between the founders? I
really am curious. 

http://www.cyber-duck.co.uk is even silly with animated duck-people. 

And I think you need to use more buzzwords and acronyms here "We produce
brands and award winning user centered websites with superior web 2.0
technologies. We conduct online marketing to drive traffic and generate
conversions." and "Cyber-Duck's ethos is that every interaction should
have
a meaningful purpose. For our clients this means that we focus on
generating
tangible results that are meaningful for businesses. For website users
that
means that we focus on generating a positive experience that will entice
them to buy your product, sign up to your newsletter, comment on your
blog
or distribute your video to their contacts." Perhaps this page will
help:
http://www.robietherobot.com/buzzword.htm

Also, why do you have (http://www.cyber-duck.co.uk/#duck%281%29) :
        1 director
        3 managers
        3 designers
        1 programmer <-- ONE?!? Sounds like a lot of chiefs and not
enough
indians.

OMFG! They all use duck caricatures. If the name wasn't a deterrent,
this
thought alone would be. I will concede that the History duck -> manduck
is
clever. :-)

*sigh*

> -----Original Message-----
> From: Jerome Botbol [mailto:[email protected]] 
> Sent: Monday, September 14, 2009 10:38 AM
> To: [email protected]
> Subject: [PHP] PHP GURU NEEDED
> 
> Hi All,
> 
> Cyber-Duck are looking for a highly motivated PHP / CSS Guru 
> to join our blah blah blah...


--- End Message ---
--- Begin Message ---
It seems that list list has degenerated into a kindergarten brawl.

Is there a moderator here? Someone to silence all this name calling and
of topic non-sense

--- End Message ---
--- Begin Message ---
On Tue, 2009-09-15 at 08:22 -0400, Patrick wrote:
> It seems that list list has degenerated into a kindergarten brawl.
> 
> Is there a moderator here? Someone to silence all this name calling and
> of topic non-sense
> 
I'll give you kindergarten you Yank! ;)

I think the list is meant to be self moderating, although my best guess
as to how that happens is to shout people down... On the plus side, it
does give way to some amusing emails!

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---
It is good to hear that they teach PHP in kindergarden these days.

//Yeti

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

> It is good to hear that they teach PHP in kindergarden these days.

I've heard it's soon to be part of the national curriculum here in the UK.

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 5th September)
Lots of PHP and Javascript code - http://www.phpguru.org

--- End Message ---
--- Begin Message ---
On Tue, 2009-09-15 at 13:45 +0100, Richard Heyes wrote:
> Hi,
> 
> > It is good to hear that they teach PHP in kindergarden these days.
> 
> I've heard it's soon to be part of the national curriculum here in the UK.
> 
> -- 
> Richard Heyes
> HTML5 graphing: RGraph - www.rgraph.net (updated 5th September)
> Lots of PHP and Javascript code - http://www.phpguru.org
> 
I hope not, I'm not having some toddler doing me out of a job!

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---

Reply via email to