<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"ms sans";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Rick,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I generally do the free_result() and
close() every time, just for good practice. As far as instantiating a
class, I generally included the class at the top of the page then instantiate
it once. I have instantiated a class more than once before, but it’s
usually not necessary. It doesn’t cause any harm to instantiate
more than one instance of a class (it probably causes more load, which may or
may not be a significant factor).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I agree, mysqli is great.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Carl Olsen<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
ciapug-bounces@cialug.org [mailto:ciapug-bounces@cialug.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Wyatt, Rich<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, February 10, 2006
1:41 PM<br>
<b><span style='font-weight:bold'>To:</span></b> ciapug@cialug.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [ciapug] PHP 5 and MySQLI</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello all… <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I recently built a new web server using PHP5 & MySQL
5. For some reason or another I couldn’t get PHP to compile with
both imagick and the standard mysql library so I used the mysqli (MySQL
Improved) config attribute and have since read through the PHP manual about
using this new class. Very cool.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>However – I seem to be running into problems with page
load. Particularly if, let’s say, I go to the home page which has
much MySQL. If I hit refresh – it bombs… Just sits and loads
and loads and loads… <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Am I forgetting to $rslt->close(); a result somewhere or
is this necessary for every single result set?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I’ve created a mysqli instance in a file called
begin.php… $db = new
myslqi(‘host’,’uname’,’pword’,’dbname’);
Can I use that $db-> everywhere or do I need to keep re-instantiating
the class every time in each new script?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I’m just new to PHP 5 so if someone could give me some
example code (other than PHP.NET – while it is explanatory it only shows
how to handle it for one query… )<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Any insights on anything that I might be missing or
overlooking from the perspective of one who is extremely familiar with the PHP4
“way of doing things with mysql” vs how to do them now with PHP5
and the MySQLI way of doing things.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=2 color=navy face="ms sans"><span
style='font-size:10.0pt;font-family:"ms sans";color:navy;font-weight:bold'>Rich
S. Wyatt</span></font></b><font color=navy><span style='color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="ms sans"><span
style='font-size:10.0pt;font-family:"ms sans";color:navy'>Webmaster / Deltek
Vision Project Manager</span></font><font color=blue><span style='color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><strong><b><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Bloodgood Sharp Buster Architects and
Planners, Inc.</span></font></b></strong><font color=blue><span
style='color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="ms sans"><span
style='font-size:10.0pt;font-family:"ms sans";color:navy'>Corporate-Des Moines</span></font><font
color=blue><span style='color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="ms sans"><span
style='font-size:10.0pt;font-family:"ms sans";color:navy'>Office: 515.273.3020
Fax: 515.221.3272<o:p></o:p></span></font></p>
<p class=MsoNormal><u><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'><a href="http://www.bsbdesign.com/"
title="http://www.bsbdesign.com/"><font size=2 color=navy face="ms sans"><span
style='font-size:10.0pt;font-family:"ms sans";color:navy'><span
title="http://www.bsbdesign.com/"><span title="http://www.bsbdesign.com/">www.bsbdesign.com</span></span></span></font></a></span></font></u><u><font
size=2 color=navy face="ms sans"><span style='font-size:10.0pt;font-family:
"ms sans";color:navy'> </span></font></u><font color=blue><span
style='color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><em><i><font size=2 color=black face="Times New Roman"><span
style='font-size:10.0pt;color:black'>National Experience, Regional Sensitivity</span></font></i></em><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center>
</span></font></div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>NOTICE: This email (including attachments) is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be
legally privileged. If you are not the intended recipient, you are hereby
notified that any retention, dissemination, distribution, or copying of this
communication is strictly prohibited. Please reply to the sender that you have
received the message in error then delete it. <o:p></o:p></span></font></p>
</div>
</div>
</body>
</html>