Reply to create a sequence in MySQL, with mysql variable?

Your name:

Reply:


Posted by awebguynow on 01/08/07 16:54

This might be fairly easy to do and I think I've seen the code before,
but I haven't seen many good examples of this. Of course Pear::DB
probably uses this code in some of its API, probably in dealing with
auto-increment indexes and prepared statements.

Maybe I'm off base here, but I'm looking for something like this:
(psuedo-code)
Of course the seq table only needs 1 row holding id, which is
updated.
select id from tbl;
// get result resouce and do fetch, store value in $myid
set @myvar = $myid + 1; // can php send to MySQL with a query? (
never seen this )
update myseq set id=@myvar // send this statement through in a
update/query

// for use in PHP code
$newSeqVal = $myid +1

A link to an example would be great.
TIA

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация