<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=Big5" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Note that avpops is deprecated in upcoming SER 2.0&nbsp; (still present, but
not maintained). Selects, avps and a couple of more powerful modules
take over.<br>
See docs:<br>
<a class="moz-txt-link-freetext" href="http://www.iptel.org/ser/doc/modules/avpops">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 cite="mid002201c77c47$b5ca6150$211016a3@nctu" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.2900.3059" name="GENERATOR">
  <style></style>
  <div><font size="2">Dear all:<br>
&nbsp;avpops module' exported function avp_db_delete() can do delete one
record?</font></div>
  <div>&nbsp;</div>
  <div><font size="2">example:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I use "test" as default table that has two fields.</font></div>
  <div>&nbsp;</div>
  <div><font size="2">username |&nbsp; number<br>
-------------------<br>
bob&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 1<br>
alice&nbsp;&nbsp;&nbsp; |&nbsp; 1<br>
bob&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 2</font></div>
  <div>&nbsp;</div>
  <div><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></div>
  <div>&nbsp;</div>
  <div><font size="2">if (method=="INVITE"){<br>
&nbsp;&nbsp; avp_db_load("$from/username", "$num/$number_scheme");&nbsp;&nbsp; //load from
table "test" ,number column as string value into AVP name '$num'<br>
&nbsp;&nbsp; avp_db_delete("$from/username", "s:test")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //delete all bob'
record<br>
};</font></div>
  <div>&nbsp;</div>
  <div><font size="2">if bob calling then bob'record has deleted</font></div>
  <div>&nbsp;</div>
  <div><font size="2">username&nbsp; |&nbsp; number<br>
--------------------<br>
alice&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 1</font></div>
  <div>&nbsp;</div>
  <div><font size="2">But i want delete a record.<br>
ex: delete number value is 1 for bob</font></div>
  <div>&nbsp;</div>
  <div><font size="2">username&nbsp; |&nbsp; number<br>
--------------------<br>
alice&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 1<br>
---------------------<br>
bob&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 2 </font></div>
  <div>&nbsp;</div>
  <div><font size="2">avp_db_delete() can do delete one record? </font></div>
  <div>&nbsp;</div>
  <div><font size="2">Another question is avp_db_store() can do insert
new data in table?</font></div>
  <div>&nbsp;</div>
  <div><font size="2">ex:&nbsp; insert into test (username,number) values
("mary","3")</font></div>
  <div>&nbsp;</div>
  <div><font size="2">username&nbsp; |&nbsp; number<br>
-------------------<br>
alice&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1<br>
-------------------<br>
bob&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 2<br>
-------------------<br>
mary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 3</font></div>
  <div>&nbsp;</div>
  <div><font size="2">avp_db_store() can do it?</font></div>
  <div>&nbsp;</div>
  <div><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></div>
  <div>&nbsp;</div>
  <div><font size="2">Chungyu </font></div>
  <div>&nbsp;</div>
  <div><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Serusers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a>
  </pre>
</blockquote>
</body>
</html>