php-general Digest 28 Jun 2013 21:56:02 -0000 Issue 8281

2013-06-28 Thread php-general-digest-help

php-general Digest 28 Jun 2013 21:56:02 - Issue 8281

Topics (messages 321515 through 321517):

Re: Reseting the auto-increment number in a MySQL database.
321515 by: adriano
321516 by: Paul M Foster
321517 by: Tedd Sperling

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


--
---BeginMessage---


holes in sequence of auto increment happen using transaction for insert 
new record but you don't commit transaction itself

it seems that the autoincrement is incremented anyway
at least this is my case.

---End Message---
---BeginMessage---
On Thu, Jun 27, 2013 at 11:47:28PM +0200, adriano wrote:

 
 holes in sequence of auto increment happen using transaction for
 insert new record but you don't commit transaction itself
 it seems that the autoincrement is incremented anyway
 at least this is my case.

I think what Tedd was referring to was something else. The hole was
quite large. I've seen this behavior myself, in PostgreSQL. From one
transaction to the next, there were over 10,000 skipped numbers, and
only me and my wife on the system. Some sort of bug, like a spinlock
that wasn't interrupted the way it should have been. I remember the
system taking forever to calm down before it gave the next transaction a
number way forward of the last one. I waited in front of my browser for
quite some time. But I couldn't explain why.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
---End Message---
---BeginMessage---
On Jun 27, 2013, at 8:47 PM, Paul M Foster pa...@quillandmouse.com wrote:

 On Thu, Jun 27, 2013 at 11:47:28PM +0200, adriano wrote:
 
 holes in sequence of auto increment happen using transaction for
 insert new record but you don't commit transaction itself
 it seems that the autoincrement is incremented anyway
 at least this is my case.
 
 I think what Tedd was referring to was something else. The hole was
 quite large. I've seen this behavior myself, in PostgreSQL. From one
 transaction to the next, there were over 10,000 skipped numbers, and
 only me and my wife on the system. Some sort of bug, like a spinlock
 that wasn't interrupted the way it should have been. I remember the
 system taking forever to calm down before it gave the next transaction a
 number way forward of the last one. I waited in front of my browser for
 quite some time. But I couldn't explain why.
 
 Paul

Yes, it was something like what Paul said -- it was not a transaction skip.

I don't know what to think about it -- no explanation.

But, the problem suddenly vanished -- very strange.

Cheers,

tedd

_
tedd.sperl...@gmail.com
http://sperling.com
---End Message---


Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-28 Thread Tedd Sperling
On Jun 27, 2013, at 8:47 PM, Paul M Foster pa...@quillandmouse.com wrote:

 On Thu, Jun 27, 2013 at 11:47:28PM +0200, adriano wrote:
 
 holes in sequence of auto increment happen using transaction for
 insert new record but you don't commit transaction itself
 it seems that the autoincrement is incremented anyway
 at least this is my case.
 
 I think what Tedd was referring to was something else. The hole was
 quite large. I've seen this behavior myself, in PostgreSQL. From one
 transaction to the next, there were over 10,000 skipped numbers, and
 only me and my wife on the system. Some sort of bug, like a spinlock
 that wasn't interrupted the way it should have been. I remember the
 system taking forever to calm down before it gave the next transaction a
 number way forward of the last one. I waited in front of my browser for
 quite some time. But I couldn't explain why.
 
 Paul

Yes, it was something like what Paul said -- it was not a transaction skip.

I don't know what to think about it -- no explanation.

But, the problem suddenly vanished -- very strange.

Cheers,

tedd

_
tedd.sperl...@gmail.com
http://sperling.com

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



Re: [PHP] Problem with variables

2013-06-28 Thread Tamara Temple
Fernando A soporteallpurp...@gmail.com wrote:
 I am working with php and codeigniter, but I have not yet experienced.
 I need create a variable that is available throughout  system.
 This variable contains the number of company and can change.
 as I can handle this?

Hi, Fernando, welcome. I'm just a little unsure what you mean by number
of company -- is this a count, as in 10 companies, or is it a phone
number, or is it something else?

Jim's reply is workable -- storing session values is quite useful, but
sessions are tied to a specific browser client/ip, and I'm not sure
that's what you want/need here.

If you are looking for setting a global variable that will be available
everywhere in your application, you can use $GLOBALS, or set it from the
very top level context of the application. Given you're using
CodeIgniter, which sadly I am not versed in, you may need to set it with
$GLOBALS: 

$GLOBALS['my_var'] = 10; // whatever you need to do here

When you say it changes, how and when exactly does it change?


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



Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-28 Thread Tamara Temple
Tedd Sperling tedd.sperl...@gmail.com wrote:
 On Jun 27, 2013, at 8:47 PM, Paul M Foster pa...@quillandmouse.com wrote:
 
  On Thu, Jun 27, 2013 at 11:47:28PM +0200, adriano wrote:
  
  holes in sequence of auto increment happen using transaction for
  insert new record but you don't commit transaction itself
  it seems that the autoincrement is incremented anyway
  at least this is my case.
  
  I think what Tedd was referring to was something else. The hole was
  quite large. I've seen this behavior myself, in PostgreSQL. From one
  transaction to the next, there were over 10,000 skipped numbers, and
  only me and my wife on the system. Some sort of bug, like a spinlock
  that wasn't interrupted the way it should have been. I remember the
  system taking forever to calm down before it gave the next transaction a
  number way forward of the last one. I waited in front of my browser for
  quite some time. But I couldn't explain why.
  
  Paul
 
 Yes, it was something like what Paul said -- it was not a transaction skip.
 
 I don't know what to think about it -- no explanation.
 
 But, the problem suddenly vanished -- very strange.
 
 Cheers,
 
 tedd
 
 _
 tedd.sperl...@gmail.com
 http://sperling.com

I have no answers as to why the huge skip forward, the huge skip
backwards though makes me think someone else is doing something in the
database, and all the alarums and red flags are waving. I hope I'm
wrong.

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