Location: PHPKode > projects > MySQL-XML > docs/attribute.inc.source.html
<HTML>
<HEAD><TITLE>PHPXref : /attribute.inc source</TITLE></HEAD>
<BODY BGCOLOR="#EEEEE0" TEXT="#330505" LINK="#801800" VLINK="#300540" ALINK="#FFFFFF">
<TABLE BORDER=0 WIDTH=100%>
	<TR BGCOLOR="553333"><TD ALIGN="RIGHT">
		<FONT SIZE=+2 COLOR="#FFFFFF"><I>PHPXref Example</I></FONT>
	</TD></TR>
</TABLE>
<BR><BR>


<!-- Generated by PHPXref 0.2 at Wed Oct 30 08:50:37 2002 -->
<!-- PHPXref (c) 2000,2001 Gareth Watts - hide@address.com -->
<!-- http://phpxref.sourceforge.net/ -->

<SCRIPT LANGUAGE="JavaScript">
<!--
ext='.html';
relbase='';
function jump() {
    if (document.search.funcname.value.length) {
		funcname=document.search.funcname.value.replace(/[()]/g,'');
		funcname=document.search.funcname.value.toLowerCase();
        window.location=relbase+'_functions/'+escape(escape(funcname))+ext;
	}
    if (document.search.varname.value.length) {
		varname=document.search.varname.value.replace(/[$]/g,'');
        window.location=relbase+'_variables/'+escape(escape(varname))+ext;
	}
    if (document.search.tablename.value.length) {
		tablename=document.search.tablename.value.toLowerCase();
        window.location=relbase+'_tables/'+escape(escape(tablename))+ext;
	}
    return false;
}

document.writeln('<TABLE ALIGN="RIGHT" BORDER=0>');
document.writeln('<TR BGCOLOR="#000000"><TD>');
document.writeln('<CENTER><FONT SIZE=-1 COLOR="#EEEEEE"><B>Lookup</B></FONT></CENTER>');
document.writeln('</TD></TR>');

document.writeln('<TR BGCOLOR="#DDDDD0"><TD ALIGN="RIGHT">');
document.writeln('<FONT SIZE=-1>');
document.writeln('<FORM NAME="search" onSubmit=\'return jump()\'>');
document.writeln('<A HREF="_functions/index.html">Function</A>: ');
document.writeln('<INPUT TYPE="TEXT" SIZE=10 VALUE="" NAME="funcname" onChange=\'jump()\'><BR>');
document.writeln('<A HREF="_variables/index.html">Variable</A>: ');
document.writeln('<INPUT TYPE="TEXT" SIZE=10 VALUE="" NAME="varname" onChange=\'jump()\'><BR>');
document.writeln('<A HREF="_tables/index.html">Table</A>: ');
document.writeln('<INPUT TYPE="TEXT" SIZE=10 VALUE="" NAME="tablename" onChange=\'jump()\'><BR>');
document.writeln('</FORM>');
document.writeln('</FONT>');
document.writeln('</TD></TR></TABLE>');
// -->
</SCRIPT>
<FONT FACE="Clean" SIZE=-2>
<A HREF="./index.html">/</A> -> <A HREF="attribute.inc.html">attribute.inc</A><BR><P>
<A NAME="l1"><FONT SIZE=-2 COLOR="#555555">1</FONT>&nbsp;</A> &lt;?<BR>
<A NAME="l2"><FONT SIZE=-2 COLOR="#555555">2</FONT>&nbsp;</A> class ATTRIBUTE {<BR>
<A NAME="l3"><FONT SIZE=-2 COLOR="#555555">3</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** element id number */<BR>
<A NAME="l4"><FONT SIZE=-2 COLOR="#555555">4</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var <A HREF="_variables/element.html">$element</A>;<BR>
<A NAME="l5"><FONT SIZE=-2 COLOR="#555555">5</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** name */<BR>
<A NAME="l6"><FONT SIZE=-2 COLOR="#555555">6</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var <A HREF="_variables/name.html">$name</A>;<BR>
<A NAME="l7"><FONT SIZE=-2 COLOR="#555555">7</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** value */<BR>
<A NAME="l8"><FONT SIZE=-2 COLOR="#555555">8</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var <A HREF="_variables/value.html">$value</A>;<BR>
<A NAME="l9"><FONT SIZE=-2 COLOR="#555555">9</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** id number */<BR>
<A NAME="l10"><FONT SIZE=-2 COLOR="#555555">10</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var <A HREF="_variables/id.html">$id</A>;<BR>
<A NAME="l11"><FONT SIZE=-2 COLOR="#555555">11</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<A NAME="l12"><FONT SIZE=-2 COLOR="#555555">12</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <A HREF="_functions/add.html">add</A>() {<BR>
<A NAME="l13"><FONT SIZE=-2 COLOR="#555555">13</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** globalize db connection */<BR>
<A NAME="l14"><FONT SIZE=-2 COLOR="#555555">14</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;global <A HREF="_variables/db.html">$db</A>;<BR>
<A NAME="l15"><FONT SIZE=-2 COLOR="#555555">15</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/this.html">$this</A>-&gt;name = <A HREF="_functions/strtolower.html">strtolower</A>(<A HREF="_variables/this.html">$this</A>-&gt;name);<BR>
<A NAME="l16"><FONT SIZE=-2 COLOR="#555555">16</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/this.html">$this</A>-&gt;value = <A HREF="_functions/strtolower.html">strtolower</A>(<A HREF="_variables/this.html">$this</A>-&gt;value);<BR>
<A NAME="l17"><FONT SIZE=-2 COLOR="#555555">17</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** add the attribute to the database */<BR>
<A NAME="l18"><FONT SIZE=-2 COLOR="#555555">18</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/query.html">$query</A> = &quot;INSERT INTO ATTRIBUTES SET<BR>
<A NAME="l19"><FONT SIZE=-2 COLOR="#555555">19</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAME = '<A HREF="_variables/this.html">$this</A>-&gt;name',<BR>
<A NAME="l20"><FONT SIZE=-2 COLOR="#555555">20</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUE = '<A HREF="_variables/this.html">$this</A>-&gt;value',<BR>
<A NAME="l21"><FONT SIZE=-2 COLOR="#555555">21</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELEMENT = <A HREF="_variables/this.html">$this</A>-&gt;element&quot;;<BR>
<A NAME="l22"><FONT SIZE=-2 COLOR="#555555">22</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/result.html">$result</A> = <A HREF="_functions/mysql_query.html">mysql_query</A>(<A HREF="_variables/query.html">$query</A>);<BR>
<A NAME="l23"><FONT SIZE=-2 COLOR="#555555">23</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<A NAME="l24"><FONT SIZE=-2 COLOR="#555555">24</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/** get the attributes id number */<BR>
<A NAME="l25"><FONT SIZE=-2 COLOR="#555555">25</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/this.html">$this</A>-&gt;id = <A HREF="_functions/mysql_insert_id.html">mysql_insert_id</A>(<A HREF="_variables/db.html">$db</A>);<BR>
<A NAME="l26"><FONT SIZE=-2 COLOR="#555555">26</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<A NAME="l27"><FONT SIZE=-2 COLOR="#555555">27</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<A NAME="l28"><FONT SIZE=-2 COLOR="#555555">28</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <A HREF="_functions/update.html">update</A>() {<BR>
<A NAME="l29"><FONT SIZE=-2 COLOR="#555555">29</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_functions/if.html">if</A>(!<A HREF="_variables/this.html">$this</A>-&gt;id) <A HREF="_variables/this.html">$this</A>-&gt;<A HREF="_functions/add.html">add</A>();<BR>
<A NAME="l30"><FONT SIZE=-2 COLOR="#555555">30</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/query.html">$query</A> = &quot;UPDATE ATTRIBUTES SET<BR>
<A NAME="l31"><FONT SIZE=-2 COLOR="#555555">31</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAME = '<A HREF="_variables/this.html">$this</A>-&gt;name',<BR>
<A NAME="l32"><FONT SIZE=-2 COLOR="#555555">32</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUE = '<A HREF="_variables/this.html">$this</A>-&gt;value'<BR>
<A NAME="l33"><FONT SIZE=-2 COLOR="#555555">33</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE ID = <A HREF="_variables/this.html">$this</A>-&gt;id&quot;;<BR>
<A NAME="l34"><FONT SIZE=-2 COLOR="#555555">34</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/result.html">$result</A> = <A HREF="_functions/mysql_query.html">mysql_query</A>(<A HREF="_variables/query.html">$query</A>);<BR>
<A NAME="l35"><FONT SIZE=-2 COLOR="#555555">35</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<A NAME="l36"><FONT SIZE=-2 COLOR="#555555">36</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<A NAME="l37"><FONT SIZE=-2 COLOR="#555555">37</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <A HREF="_functions/delete.html">delete</A>() {<BR>
<A NAME="l38"><FONT SIZE=-2 COLOR="#555555">38</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/query.html">$query</A> = &quot;DELETE FROM ATTRIBUTES WHERE<BR>
<A NAME="l39"><FONT SIZE=-2 COLOR="#555555">39</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID = <A HREF="_variables/this.html">$this</A>-&gt;id&quot;;<BR>
<A NAME="l40"><FONT SIZE=-2 COLOR="#555555">40</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<A NAME="l41"><FONT SIZE=-2 COLOR="#555555">41</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="_variables/result.html">$result</A> = <A HREF="_functions/mysql_query.html">mysql_query</A>(<A HREF="_variables/query.html">$query</A>);<BR>
<A NAME="l42"><FONT SIZE=-2 COLOR="#555555">42</FONT>&nbsp;</A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<A NAME="l43"><FONT SIZE=-2 COLOR="#555555">43</FONT>&nbsp;</A> }<BR>
<A NAME="l44"><FONT SIZE=-2 COLOR="#555555">44</FONT>&nbsp;</A> ?&gt;<BR>
</FONT>
<BR><HR>
<TABLE WIDTH=100%>
	<TR><TD>Generated: Wed Oct 30 08:50:37 2002</TD>
	<TD ALIGN="RIGHT"><I>Generated by <A HREF="http://phpxref.sourceforge.net/">PHPXref 0.2</A></I></TD>
	</TR>
</TABLE>
</BODY></HTML>
Return current item: MySQL-XML