<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="OPENWEBMAIL" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<font size="2">You know, Greger... it's statements like that that absolutely terrify me away from trying to migrate our production setup to the new SER. :)
<br />
<br />We use avpops for just about EVERYthing. :) And I still don't understand the selects, though I've looked at them.
<br />
<br />Daunting, I tell you.
<br />
<br />N.
<br /></font><font size="2"><b>
<br />On Thu, 12 Apr 2007 21:09:59 +0200, Greger V. Teigre wrote</b>
<br />>
Note that avpops is deprecated in upcoming SER 2.0 (still present,
but
not maintained). Selects, avps and a couple of more powerful
modules
take over.
<br />>
See docs:
<br />>
<a href="http://www.iptel.org/ser/doc/modules/avpops" class="moz-txt-link-freetext">http://www.iptel.org/ser/doc/modules/avpops</a>
<br />>
You need an attribute column defined (in your dbscheme), which
should
be identified in the second param to avp_db_delete.
<br />>
g-)
<br />>
<br />>
chungyu
wrote:
<blockquote type="cite" cite="http://www.arcdiv.com/cgi-bin/owm/mid002201c77c47$b5ca6150$211016a3@nctu">
<!-- style
begin
style end
-->
<br />> <font size="2">Dear all:
<br />>
avpops module' exported function avp_db_delete() can do delete
one
record?</font>
<br />>
<br />> <font size="2">example:
<br />>
I use "test" as
default table that has two
fields.</font>
<br />>
<br />> <font size="2">username | number
<br />>
-------------------
<br />>
bob | 1
<br />>
alice | 1
<br />>
bob |
2</font>
<br />>
<br />> <font size="2">my configuration:
<br />>
modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser")
<br />>
modparam("avpops", "avp_table", "test")
<br />>
modparam("avpops", "username_column", "username")
<br />>
modparam("avpops", "avp_aliases", "num=i:55")
<br />>
modparam("avpops",
"db_scheme",
"number_scheme:table=test;value_col=number;value_type=string")</font>
<br />>
<br />> <font size="2">if (method=="INVITE"){
<br />>
avp_db_load("$from/username", "$num/$number_scheme");
//load
from
table "test" ,number column as string value into AVP name '$num'
<br />>
avp_db_delete("$from/username", "s:test")
//delete all
bob'
record
<br />>
};</font>
<br />>
<br />> <font size="2">if bob calling then bob'record has
deleted</font>
<br />>
<br />> <font size="2">username | number
<br />>
--------------------
<br />>
alice |
1</font>
<br />>
<br />> <font size="2">But i want delete a record.
<br />>
ex: delete number value is 1 for
bob</font>
<br />>
<br />> <font size="2">username | number
<br />>
--------------------
<br />>
alice | 1
<br />>
---------------------
<br />>
bob | 2
</font>
<br />>
<br />> <font size="2">avp_db_delete() can do delete one record?
</font>
<br />>
<br />> <font size="2">Another question is avp_db_store() can do
insert
new data in
table?</font>
<br />>
<br />> <font size="2">ex: insert into test (username,number)
values
("mary","3")</font>
<br />>
<br />> <font size="2">username | number
<br />>
-------------------
<br />>
alice | 1
<br />>
-------------------
<br />>
bob | 2
<br />>
-------------------
<br />>
mary |
3</font>
<br />>
<br />> <font size="2">avp_db_store() can do
it?</font>
<br />>
<br />> <font size="2">sorry,I still can't understand what it mean
about
avp_db_store() and avp_db_delete().
<br />>
Can tell me?
<br />>
Thanks a lot in
advance</font>
<br />>
<br />> <font size="2">Chungyu
</font>
<br />>
<br />>
<pre wrap="">
<hr width="90%" size="4" />
_______________________________________________
Serusers mailing
list
<a href="mailto:Serusers@lists.iptel.org" class="moz-txt-link-abbreviated">Serusers@lists.iptel.org</a>
<a href="http://lists.iptel.org/mailman/listinfo/serusers" class="moz-txt-link-freetext">http://lists.iptel.org/mailman/listinfo/serusers</a>
</pre>
</blockquote>
<br />
<br />
<br />
</font>
</BODY>
</HTML>