|
< >设计这个类的目的是为了实用,提高效率,不求包含的功能有多全,比如它不提供整理 SQL 语句的功能,因为我觉得那些功能可以在单独的查询语句生成类中实现,这样比在这里写几个通用的简单的 SQL 语句整理功能强的多。但是这个类提供的功能绝对够你用了。如果你觉得哪儿里设计的还不合理,或者你认为还应该增加什么功能,非常欢迎能留下你的高见。</P>< >顺便说一下,程序我没写注释,因为我觉得太简单了,没有必要注释。</P><DIV class=hl-surround><OL class="hl-main ln-show" ondblclick=linenumber(this) title="Double click to hide line number."><LI class=hl-firstline><SPAN style="COLOR: blue"><?php</SPAN><LI><SPAN style="COLOR: #ffa500">/**</SPAN><LI><SPAN style="COLOR: #ffa500">*</SPAN><SPAN style="COLOR: blue"> @author </SPAN><SPAN style="COLOR: #ffa500">马秉尧</SPAN><LI><SPAN style="COLOR: #ffa500">*</SPAN><SPAN style="COLOR: blue"> @copyright </SPAN><SPAN style="COLOR: #ffa500">(C) 2005 CoolCode.CN</SPAN><LI><SPAN style="COLOR: #ffa500">*</SPAN><SPAN style="COLOR: blue"> @package </SPAN><SPAN style="COLOR: #ffa500">class_mysql.php</SPAN><LI><SPAN style="COLOR: #ffa500">*</SPAN><SPAN style="COLOR: blue"> @version </SPAN><SPAN style="COLOR: #ffa500">0.8</SPAN><LI><SPAN style="COLOR: #ffa500">*/</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: green">class</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$debug</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$user</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$pass</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$linkid</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$queryid</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$affected_rows</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$result</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$errno</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$error</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">var</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$sqls</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">array</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$user</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$pass</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$charset</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">UTF8</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$debug</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">!</SPAN><SPAN style="COLOR: blue">extension_loaded</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">mysql</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">strtoupper</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">substr</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue"> HP_OS</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: maroon">0</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: maroon">3</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"> == </SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">WIN</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">dl</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">php_mysql.dll</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">dl</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">mysql.so</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$debug</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray"> != </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">connect</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$user</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$pass</SPAN><SPAN style="COLOR: olive">)))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">mysql_get_server_info</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray"> >= </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">4.1</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">set names </SPAN><SPAN style="COLOR: #00008b">$charset</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: gray"> != </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">select_db</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">register_shutdown_function</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: green">array</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">&</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">shutdown</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">connect</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$user</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$pass</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">host</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$host</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">user</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$user</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">pass</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$pass</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_connect</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">host</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">user</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">pass</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: gray"> = @</SPAN><SPAN style="COLOR: blue">mysql_connect</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">host</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">user</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">pass</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">select_db</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">name</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$name</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">!</SPAN><SPAN style="COLOR: blue">mysql_select_db</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">name</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">!@</SPAN><SPAN style="COLOR: blue">mysql_select_db</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">name</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$type</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: red">assoc</SPAN><SPAN style="COLOR: #8b0000">'</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_array</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$err</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">foreach</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">as</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: #00008b">$s</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">!</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$s</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$err</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">true</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: gray">!@</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$s</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$err</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">true</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">preg_match</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">/^\s*(delete|insert|replace|update)/i</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$s</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">affected_rows</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_affected_rows</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> !</SPAN><SPAN style="COLOR: #00008b">$err</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray"> != </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray"> = @</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">preg_match</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">/^\s*(delete|insert|replace|update)/i</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">affected_rows</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_affected_rows</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">mysql_num_rows</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"> == </SPAN><SPAN style="COLOR: maroon">0</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: maroon">0</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">((</SPAN><SPAN style="COLOR: blue">mysql_num_rows</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"> == </SPAN><SPAN style="COLOR: maroon">1</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: green">and</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">preg_match</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">/limit\s+1\s*$|limit\s+1\s*[^,]+/i</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">call_user_func</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">mysql_fetch_</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray"> . </SPAN><SPAN style="COLOR: #00008b">$type</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">array</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">while</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">call_user_func</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">mysql_fetch_</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray"> . </SPAN><SPAN style="COLOR: #00008b">$type</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">array_push</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray"> === </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">explain</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray"> != </SPAN><SPAN style="COLOR: #8b0000">''</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">EXPLAIN </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray"> . </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: gray"> = @</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">EXPLAIN </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray"> . </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: green">array</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">while</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_fetch_array</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">queryid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">array_push</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">result</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">last_insert_id</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$result</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">select LAST_INSERT_ID() as `last_insert_id`</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$result</SPAN><SPAN style="COLOR: gray"> = @</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">select LAST_INSERT_ID() as `last_insert_id`</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$result</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_fetch_object</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$result</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$row</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">last_insert_id</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">errno</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_errno</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">error</SPAN><SPAN style="COLOR: gray"> = </SPAN><SPAN style="COLOR: blue">mysql_error</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">affected_rows</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">affected_rows</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">register_shutdown_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">array_push</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sqls</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">shutdown</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">foreach</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">sqls</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">as</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> @</SPAN><SPAN style="COLOR: blue">mysql_query</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$sql</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"></SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">close</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">debug</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql_close</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> @</SPAN><SPAN style="COLOR: blue">mysql_close</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">function</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">escape_string</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$string</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">version_compare</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">phpversion</SPAN><SPAN style="COLOR: olive">()</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">4.3.0</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"> == </SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: red">-1</SPAN><SPAN style="COLOR: #8b0000">"</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql_escape_string</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$string</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">if</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: blue">is_resource</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">))</SPAN><SPAN style="COLOR: gray"></SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: blue">mysql_real_escape_string</SPAN><SPAN style="COLOR: olive">(</SPAN><SPAN style="COLOR: #00008b">$string</SPAN><SPAN style="COLOR: gray">, </SPAN><SPAN style="COLOR: #00008b">$this</SPAN><SPAN style="COLOR: gray">-></SPAN><SPAN style="COLOR: blue">linkid</SPAN><SPAN style="COLOR: olive">)</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">else</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">{</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">return</SPAN><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: green">false</SPAN><SPAN style="COLOR: gray">;</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: gray"> </SPAN><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: olive">}</SPAN><LI><SPAN style="COLOR: blue">?></SPAN></LI></OL></DIV> |
|