<div>Dear sunkara,</div> <div> </div> <div>Thank you very much for your kind-hearted for answering my question, Thank you very much.</div> <div>If I can ask you more, would you mind tell me what is the name the application that I can use like "serweb" in openser server ? (the suitable "serweb" for openser server) because I am building openser server. and would you mind tell me where I can get it? </div> <div>Please help me, Sunkara..Please...Please...</div> <div>Thank you very much...Thank you...</div> <div> </div> <div>Regards,</div> <div> </div> <div>Ferianto<BR><BR><B><I>raviprakash sunkara <sunkara.raviprakash.feb14@gmail.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi siregar...<BR>I best Suggest is Not to user SERweb in openser.<BR>It application to SER only. not For openser , if U want to configure the serweb in openser U need to modify
some changes in serweb and openser tables other things.. <BR>Perhaps try it..... <BR>Best of luck...<BR><BR><BR> <DIV><SPAN class=gmail_quote>On 8/19/06, <B class=gmail_sendername>Ferianto siregar</B> <<A href="mailto:ferianto_voip@yahoo.com">ferianto_voip@yahoo.com</A>> wrote: </SPAN> <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV>Dear all,<BR><BR>Thanks to all of you for your kind-hearted answering my question. Thank you very much. <BR>Now, I am building serweb in openser. So, the client can register to become the member of communication in my openser that I have built.<BR>1. Can "serweb" (from <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://iptel.org/" target=_blank>iptel.org</A>) be used in openser server for building the webserver of the openser server? Or openser has it`s own webserver except "serweb"?<BR>2.When I build serweb (from <A
onclick="return top.js.OpenExtLink(window,event,this)" href="http://iptel.org/" target=_blank>iptel.org</A>), I have some problems. I do hope anybody can help me and give me a suggestion. Please..<BR>The error message that I got from client browser is<BR> <DIV><B>Fatal error</B>: Failed opening required 'var/www/phplib/db_mysql.inc' (include_path='.:/usr/share/pear') in <B>/var/www/html/serweb/user_interface/prepend.php</B> on line <B>23</B></DIV> <DIV><SPAN><SPAN style="FONT-WEIGHT: bold">The contain of prepend.php that shows line 23 is </SPAN><BR></SPAN></DIV> <DIV><SPAN></SPAN>require($_PHPLIB["libdir"] . "db_mysql.inc"); <SPAN> </SPAN>/* Change this to match your database. */</DIV> <DIV><SPAN style="FONT-SIZE: 12pt">I don`t know what is wrong. I do hope anybody can give me a suggestion. Please help me..Please. Thanks</SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 12pt">Regards,</SPAN></DIV> <DIV><BR><SPAN style="FONT-SIZE: 12pt"></SPAN></DIV> <DIV><SPAN
style="FONT-SIZE: 12pt">Ferianto<BR></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 12pt">Note:<BR></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 12pt">This is the contain of db_mysql.inc that I have configured <BR></SPAN></DIV> <DIV></DIV> <DIV><?php</DIV> <DIV>/*</DIV> <DIV><SPAN> </SPAN>* Session Management for PHP3</DIV> <DIV><SPAN> </SPAN>*</DIV> <DIV><SPAN> </SPAN>* Copyright (c) 1998-2000 NetUSE AG </DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>Boris Erdmann, Kristian Koehntopp</DIV> <DIV><SPAN> </SPAN>*</DIV> <DIV><SPAN> </SPAN>* $Id: db_mysql.inc,v <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://1.1.1.1/" target=_blank>1.1.1.1</A> 2002/09/04 18:19:57 kozlik Exp $</DIV> <DIV><SPAN> </SPAN>*</DIV> <DIV><SPAN> </SPAN>*/ </DIV> <DIV> </DIV> <DIV>class DB_Sql {</DIV> <DIV><SPAN>
</SPAN></DIV> <DIV><SPAN> </SPAN>/* public: connection parameters */ </DIV> <DIV><SPAN> </SPAN>var $Host<SPAN> </SPAN>= "localhost";</DIV> <DIV><SPAN> </SPAN>var $Database = "openser";</DIV> <DIV><SPAN> </SPAN>var $User<SPAN> </SPAN>= "openser";</DIV> <DIV><SPAN> </SPAN>var $Password = "openserrw";</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: configuration parameters */</DIV> <DIV><SPAN> </SPAN>var $Auto_Free<SPAN> </SPAN>= 0;<SPAN> </SPAN>## Set to 1 for automatic mysql_free_result()</DIV> <DIV><SPAN> </SPAN>var $Debug<SPAN> </SPAN>= 0;<SPAN> </SPAN>## Set to 1 for debugging messages. </DIV> <DIV><SPAN> </SPAN>var $Halt_On_Error = "yes"; ## "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore errror, but spit a
warning)</DIV> <DIV><SPAN> </SPAN>var $Seq_Table<SPAN> </SPAN>= "db_sequence";</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: result array and current row number */</DIV> <DIV><SPAN> </SPAN>var $Record<SPAN> </SPAN>= array(); </DIV> <DIV><SPAN> </SPAN>var $Row;</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: current error number and error text */</DIV> <DIV><SPAN> </SPAN>var $Errno<SPAN> </SPAN>= 0;</DIV> <DIV><SPAN> </SPAN>var $Error <SPAN> </SPAN>= "";</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: this is an api revision, not a CVS revision. */</DIV> <DIV><SPAN> </SPAN>var $type<SPAN> </SPAN>= "mysql";</DIV> <DIV><SPAN> </SPAN>var $revision = "1.2";</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* private: link and query handles */</DIV> <DIV><SPAN> </SPAN>var
$Link_ID<SPAN> </SPAN>= 0;</DIV> <DIV><SPAN> </SPAN>var $Query_ID = 0; </DIV> <DIV><SPAN> </SPAN></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: constructor */</DIV> <DIV><SPAN> </SPAN>function DB_Sql($query = "") {</DIV> <DIV><SPAN> </SPAN>$this->query($query); </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: some trivial reporting */</DIV> <DIV><SPAN> </SPAN>function link_id() {</DIV> <DIV><SPAN> </SPAN>return $this->Link_ID;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function query_id() {</DIV> <DIV><SPAN> </SPAN>return $this->Query_ID;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: connection management */</DIV> <DIV><SPAN> </SPAN>function connect($Database = "", $Host = "", $User =
"", $Password = "") {</DIV> <DIV><SPAN> </SPAN>/* Handle defaults */ </DIV> <DIV><SPAN> </SPAN>if ("" == $Database)</DIV> <DIV><SPAN> </SPAN>$Database = $this->Database;</DIV> <DIV><SPAN> </SPAN>if ("" == $Host)</DIV> <DIV><SPAN> </SPAN>$Host<SPAN> </SPAN>= $this->Host;</DIV> <DIV><SPAN> </SPAN>if ("" == $User)</DIV> <DIV><SPAN> </SPAN>$User<SPAN> </SPAN>= $this->User;</DIV> <DIV><SPAN> </SPAN>if ("" == $Password)</DIV> <DIV><SPAN> </SPAN>$Password = $this->Password;</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>/* establish connection, select database */ </DIV> <DIV><SPAN> </SPAN>if ( 0 == $this->Link_ID ) {</DIV>
<DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>$this->Link_ID=mysql_pconnect($Host, $User, $Password);</DIV> <DIV><SPAN> </SPAN>if (!$this->Link_ID) { </DIV> <DIV><SPAN> </SPAN>$this->halt("pconnect($Host, $User, \$Password) failed.");</DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>if (!@mysql_select_db($Database,$this->Link_ID)) { </DIV> <DIV><SPAN> </SPAN>$this->halt("cannot use database ".$Database);</DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN></DIV>
<DIV><SPAN> </SPAN>return $this->Link_ID;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: discard the query result */</DIV> <DIV><SPAN> </SPAN>function free() {</DIV> <DIV><SPAN> </SPAN>@mysql_free_result($this->Query_ID);</DIV> <DIV><SPAN> </SPAN>$this->Query_ID = 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: perform a query */</DIV> <DIV><SPAN> </SPAN>function query($Query_String) {</DIV> <DIV><SPAN> </SPAN>/* No empty queries, please, since PHP4 chokes on them. */</DIV> <DIV><SPAN> </SPAN>if ($Query_String == "")</DIV> <DIV><SPAN> </SPAN>/* The empty query string is passed on from the constructor,</DIV> <DIV><SPAN> </SPAN>* when calling the class without a query,
e.g. in situations</DIV> <DIV><SPAN> </SPAN>* like these: '$db = new DB_Sql_Subclass;' </DIV> <DIV><SPAN> </SPAN>*/</DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>if (!$this->connect()) {</DIV> <DIV><SPAN> </SPAN>return 0; /* we already complained in connect() about that. */ </DIV> <DIV><SPAN> </SPAN>};</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN># New query, discard previous result.</DIV> <DIV><SPAN> </SPAN>if ($this->Query_ID) {</DIV> <DIV><SPAN> </SPAN>$this->free();</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>if ($this->Debug)</DIV> <DIV><SPAN> </SPAN>printf("Debug: query = %s<br>\n",
$Query_String);</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>$this->Query_ID = @mysql_query($Query_String,$this->Link_ID);</DIV> <DIV><SPAN> </SPAN>$this->Row<SPAN> </SPAN>= 0;</DIV> <DIV><SPAN> </SPAN>$this->Errno = mysql_errno();</DIV> <DIV><SPAN> </SPAN>$this->Error = mysql_error();</DIV> <DIV><SPAN> </SPAN>if (!$this->Query_ID) {</DIV> <DIV><SPAN> </SPAN>$this->halt("Invalid SQL: ".$Query_String);</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN># Will return nada if it fails. That's fine.</DIV> <DIV><SPAN> </SPAN>return $this->Query_ID; </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: walk result set */</DIV> <DIV><SPAN> </SPAN>function next_record() {</DIV>
<DIV><SPAN> </SPAN>if (!$this->Query_ID) {</DIV> <DIV><SPAN> </SPAN>$this->halt("next_record called with no query pending.");</DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>$this->Record = @mysql_fetch_array($this->Query_ID); </DIV> <DIV><SPAN> </SPAN>$this->Row<SPAN> </SPAN>+= 1;</DIV> <DIV><SPAN> </SPAN>$this->Errno<SPAN> </SPAN>= mysql_errno();</DIV> <DIV><SPAN> </SPAN>$this->Error<SPAN> </SPAN>= mysql_error();</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>$stat = is_array($this->Record);</DIV> <DIV><SPAN> </SPAN>if (!$stat && $this->Auto_Free) {</DIV> <DIV><SPAN> </SPAN>$this->free();</DIV>
<DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>return $stat;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: position in result set */</DIV> <DIV><SPAN> </SPAN>function seek($pos = 0) {</DIV> <DIV><SPAN> </SPAN>$status = @mysql_data_seek($this->Query_ID, $pos);</DIV> <DIV><SPAN> </SPAN>if ($status)</DIV> <DIV><SPAN> </SPAN>$this->Row = $pos;</DIV> <DIV><SPAN> </SPAN>else {</DIV> <DIV><SPAN> </SPAN>$this->halt("seek($pos) failed: result has ".$this->num_rows()." rows.");</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* half assed attempt to save the day, </DIV> <DIV><SPAN> </SPAN>* but do not consider this documented or even </DIV> <DIV><SPAN> </SPAN>*
desireable behaviour.</DIV> <DIV><SPAN> </SPAN>*/</DIV> <DIV><SPAN> </SPAN>@mysql_data_seek($this->Query_ID, $this->num_rows());</DIV> <DIV><SPAN> </SPAN>$this->Row = $this->num_rows(); </DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>return 1;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: table locking */ </DIV> <DIV><SPAN> </SPAN>function lock($table, $mode = "write") {</DIV> <DIV><SPAN> </SPAN>$query = "lock tables ";</DIV> <DIV><SPAN> </SPAN>if (is_array($table)) {</DIV> <DIV><SPAN> </SPAN>while (list($key,$value) = each($table)) { </DIV> <DIV><SPAN> </SPAN>if
(!is_int($key)) {</DIV> <DIV><SPAN> </SPAN><SPAN> </SPAN>// texts key are "read", "read local", "write", "low priority write"</DIV> <DIV><SPAN> </SPAN>$query .= "$value $key, ";</DIV> <DIV><SPAN> </SPAN>} else {</DIV> <DIV><SPAN> </SPAN>$query .= "$value $mode, ";</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>$query = substr($query,0,-2);</DIV> <DIV><SPAN> </SPAN>} else {</DIV> <DIV><SPAN> </SPAN>$query .= "$table $mode";</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>$res = $this->query($query);</DIV>
<DIV><SPAN> </SPAN>if (!$res) {</DIV> <DIV><SPAN> </SPAN>$this->halt("lock() failed.");</DIV> <DIV><SPAN> </SPAN><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>return $res;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>function unlock() {</DIV> <DIV><SPAN> </SPAN>$res = $this->query("unlock tables");</DIV> <DIV><SPAN> </SPAN>if (!$res) {</DIV> <DIV><SPAN> </SPAN>$this->halt("unlock() failed."); </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>return $res;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: evaluate the result (size, width) */</DIV> <DIV><SPAN> </SPAN>function affected_rows() {
</DIV> <DIV><SPAN> </SPAN>return @mysql_affected_rows($this->Link_ID);</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function num_rows() {</DIV> <DIV><SPAN> </SPAN>return @mysql_num_rows($this->Query_ID); </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function num_fields() {</DIV> <DIV><SPAN> </SPAN>return @mysql_num_fields($this->Query_ID);</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: shorthand notation */</DIV> <DIV><SPAN> </SPAN>function nf() {</DIV> <DIV><SPAN> </SPAN>return $this->num_rows();</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function np() { </DIV> <DIV><SPAN> </SPAN>print $this->num_rows();</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN>
</SPAN>function f($Name) {</DIV> <DIV><SPAN> </SPAN>if (isset($this->Record[$Name])) {</DIV> <DIV><SPAN> </SPAN>return $this->Record[$Name];</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function p($Name) {</DIV> <DIV><SPAN> </SPAN>if (isset($this->Record[$Name])) {</DIV> <DIV><SPAN> </SPAN>print $this->Record[$Name];</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: sequence numbers */</DIV> <DIV><SPAN> </SPAN>function nextid($seq_name) {</DIV> <DIV><SPAN> </SPAN>$this->connect();</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>if ($this->lock($this->Seq_Table)) {</DIV> <DIV><SPAN>
</SPAN>/* get sequence number (locked) and increment */ </DIV> <DIV><SPAN> </SPAN>$q<SPAN> </SPAN>= sprintf("select nextid from %s where seq_name = '%s'",</DIV> <DIV><SPAN> </SPAN>$this->Seq_Table,</DIV> <DIV><SPAN> </SPAN>$seq_name); </DIV> <DIV><SPAN> </SPAN>$id<SPAN> </SPAN>= @mysql_query($q, $this->Link_ID);</DIV> <DIV><SPAN> </SPAN>$res = @mysql_fetch_array($id);</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>/* No current value, make one */ </DIV> <DIV><SPAN> </SPAN><SPAN> </SPAN>if (!is_array($res)) {</DIV> <DIV><SPAN> </SPAN>$currentid =
0;</DIV> <DIV><SPAN> </SPAN>$q = sprintf("insert into %s values('%s', %s)",</DIV> <DIV><SPAN> </SPAN>$this->Seq_Table,</DIV> <DIV><SPAN> </SPAN>$seq_name,</DIV> <DIV><SPAN> </SPAN>$currentid);</DIV> <DIV><SPAN> </SPAN>$id = @mysql_query($q, $this->Link_ID);</DIV> <DIV><SPAN> </SPAN>} else {</DIV> <DIV><SPAN> </SPAN>$currentid = $res["nextid"];</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>$nextid = $currentid + 1; </DIV>
<DIV><SPAN> </SPAN>$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",</DIV> <DIV><SPAN> </SPAN>$this->Seq_Table,</DIV> <DIV><SPAN> </SPAN>$nextid,</DIV> <DIV><SPAN> </SPAN>$seq_name);</DIV> <DIV><SPAN> </SPAN>$id = @mysql_query($q, $this->Link_ID);</DIV> <DIV><SPAN> </SPAN>$this->unlock();</DIV> <DIV><SPAN> </SPAN>} else {</DIV> <DIV><SPAN> </SPAN>$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");</DIV> <DIV><SPAN> </SPAN>return 0;</DIV> <DIV><SPAN> </SPAN>}</DIV>
<DIV><SPAN> </SPAN>return $nextid; </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: return table metadata */</DIV> <DIV><SPAN> </SPAN>function metadata($table = "", $full = false) {</DIV> <DIV><SPAN> </SPAN>$count = 0;</DIV> <DIV><SPAN> </SPAN>$id<SPAN> </SPAN>= 0;</DIV> <DIV><SPAN> </SPAN>$res<SPAN> </SPAN>= array();</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/*</DIV> <DIV><SPAN> </SPAN>* Due to compatibility problems with Table we changed the behavior </DIV> <DIV><SPAN> </SPAN>* of metadata();</DIV> <DIV><SPAN> </SPAN>* depending on $full, metadata returns the following values:</DIV> <DIV><SPAN> </SPAN>*</DIV> <DIV><SPAN> </SPAN><SPAN> </SPAN>* - full is false
(default):</DIV> <DIV><SPAN> </SPAN>* $result[]:</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["table"]<SPAN> </SPAN>table name</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["name"]<SPAN> </SPAN>field name </DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["type"]<SPAN> </SPAN>field type</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["len"]<SPAN> </SPAN>field length</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["flags"]<SPAN> </SPAN>field flags</DIV> <DIV><SPAN> </SPAN>*</DIV> <DIV><SPAN> </SPAN>* - full is true</DIV> <DIV><SPAN> </SPAN>* $result[]:</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>["num_fields"] number of
metadata records</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["table"]<SPAN> </SPAN>table name</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["name"]<SPAN> </SPAN>field name</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["type"] <SPAN> </SPAN>field type</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["len"]<SPAN> </SPAN>field length</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>[0]["flags"]<SPAN> </SPAN>field flags</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>["meta"][field name]<SPAN> </SPAN>index of field named "field name"</DIV> <DIV><SPAN> </SPAN>*<SPAN> </SPAN>This last one could be used if you have a field name, but no index. </DIV> <DIV><SPAN>
</SPAN>*<SPAN> </SPAN>Test:<SPAN> </SPAN>if (isset($result['meta']['myfield'])) { ...</DIV> <DIV><SPAN> </SPAN>*/</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>// if no $table specified, assume that we are working with a query </DIV> <DIV><SPAN> </SPAN>// result</DIV> <DIV><SPAN> </SPAN>if ($table) {</DIV> <DIV><SPAN> </SPAN>$this->connect();</DIV> <DIV><SPAN> </SPAN>$id = @mysql_list_fields($this->Database, $table);</DIV> <DIV><SPAN> </SPAN>if (!$id) {</DIV> <DIV><SPAN> </SPAN>$this->halt("Metadata query failed.");</DIV> <DIV><SPAN> </SPAN>return false; </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>} else {</DIV>
<DIV><SPAN> </SPAN>$id = $this->Query_ID; </DIV> <DIV><SPAN> </SPAN>if (!$id) {</DIV> <DIV><SPAN> </SPAN>$this->halt("No query specified."); </DIV> <DIV><SPAN> </SPAN>return false;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN></SPAN> </DIV> <DIV><SPAN> </SPAN>$count = @mysql_num_fields($id);</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>// made this IF due to performance (one if is faster than $count if's)</DIV> <DIV><SPAN> </SPAN>if (!$full) {</DIV> <DIV><SPAN> </SPAN>for ($i=0; $i<$count; $i++) {</DIV> <DIV><SPAN> </SPAN>$res[$i]["table"] = @mysql_field_table ($id, $i);</DIV>
<DIV><SPAN> </SPAN>$res[$i]["name"]<SPAN> </SPAN>= @mysql_field_name<SPAN> </SPAN>($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["type"]<SPAN> </SPAN>= @mysql_field_type<SPAN> </SPAN>($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["len"]<SPAN> </SPAN>= @mysql_field_len<SPAN> </SPAN>($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["flags"] = @mysql_field_flags ($id, $i); </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>} else { // full</DIV> <DIV><SPAN> </SPAN>$res["num_fields"]= $count;</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>for ($i=0; $i<$count; $i++) { </DIV> <DIV><SPAN>
</SPAN>$res[$i]["table"] = @mysql_field_table ($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["name"]<SPAN> </SPAN>= @mysql_field_name<SPAN> </SPAN>($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["type"]<SPAN> </SPAN>= @mysql_field_type<SPAN> </SPAN>($id, $i);</DIV> <DIV><SPAN> </SPAN>$res[$i]["len"]<SPAN> </SPAN>= @mysql_field_len<SPAN> </SPAN>($id, $i); </DIV> <DIV><SPAN> </SPAN>$res[$i]["flags"] = @mysql_field_flags ($id, $i);</DIV> <DIV><SPAN> </SPAN>$res["meta"][$res[$i]["name"]] = $i;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>// free the result only if we were called
on a table</DIV> <DIV><SPAN> </SPAN>if ($table) {</DIV> <DIV><SPAN> </SPAN>@mysql_free_result($id); </DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN>return $res;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* public: find available table names */</DIV> <DIV><SPAN> </SPAN>function table_names() { </DIV> <DIV><SPAN> </SPAN>$this->connect();</DIV> <DIV><SPAN> </SPAN>$h = @mysql_query("show tables", $this->Link_ID);</DIV> <DIV><SPAN> </SPAN>$i = 0;</DIV> <DIV><SPAN> </SPAN>while ($info = @mysql_fetch_row($h)) { </DIV> <DIV><SPAN> </SPAN>$return[$i]["table_name"]<SPAN> </SPAN>= $info[0];</DIV> <DIV><SPAN> </SPAN>$return[$i]["tablespace_name"] = $this->Database;</DIV>
<DIV><SPAN> </SPAN>$return[$i]["database"] <SPAN> </SPAN>= $this->Database;</DIV> <DIV><SPAN> </SPAN>$i++;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV><SPAN> </SPAN></DIV> <DIV><SPAN> </SPAN>@mysql_free_result($h);</DIV> <DIV><SPAN> </SPAN>return $return;</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>/* private: error handling */</DIV> <DIV><SPAN> </SPAN>function halt($msg) {</DIV> <DIV><SPAN> </SPAN>$this->Error = @mysql_error($this->Link_ID); </DIV> <DIV><SPAN> </SPAN>$this->Errno = @mysql_errno($this->Link_ID);</DIV> <DIV><SPAN> </SPAN>if ($this->Halt_On_Error == "no")</DIV> <DIV><SPAN> </SPAN>return;</DIV> <DIV> </DIV>
<DIV><SPAN> </SPAN>$this->haltmsg($msg);</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>if ($this->Halt_On_Error != "report")</DIV> <DIV><SPAN> </SPAN>die("Session halted.");</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV><SPAN> </SPAN>function haltmsg($msg) {</DIV> <DIV><SPAN> </SPAN>printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);</DIV> <DIV><SPAN> </SPAN>printf("<b>MySQL Error</b>: %s (%s)<br>\n",</DIV> <DIV><SPAN> </SPAN><SPAN> </SPAN>$this->Errno,</DIV> <DIV><SPAN> </SPAN>$this->Error);</DIV> <DIV><SPAN> </SPAN>}</DIV> <DIV> </DIV> <DIV>}</DIV> <DIV>?></DIV></DIV> <DIV><SPAN class=ad> <DIV> </DIV> <div></div> <HR SIZE=1> Yahoo! Messenger with Voice. <A onclick="return
top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com" target=_blank>Make PC-to-Phone Calls</A> to the US (and 30+ countries) for 2�/min or less. <div></div></SPAN></DIV><BR>_______________________________________________<BR>Users mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@openser.org">Users@openser.org</A><BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="http://openser.org/cgi-bin/mailman/listinfo/users" target=_blank>http://openser.org/cgi-bin/mailman/listinfo/users</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Thanks and Regards with cheers<BR>Sunkara Ravi Prakash <BR>Hyperion Technology<BR>Kondapur, Hi-tech city,<BR>Hyderabad.<BR><A href="http://www.hyperion-tech.com/">www.hyperion-tech.com</A><BR>+91-9985077535 </BLOCKQUOTE><BR><p>
                <hr size=1>Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. <a href="http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com"> Great rates starting at 1¢/min.<p> 
                <hr size=1>How low will we go? Check out Yahoo! Messenger’s low <a href="http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com"> PC-to-Phone call rates.