\doxysection{api/connect-\/local.php File Reference}
\hypertarget{connect-local_8php}{}\label{connect-local_8php}\index{api/connect-\/local.php@{api/connect-\/local.php}}


Conecta com o banco de dados.  


\doxysubsubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{connect-local_8php_a59f6106d84ceb901b027ca96381d59c8}{\$dotenv}} = Dotenv\textbackslash{}\+Dotenv\+::create\+Immutable(\+\_\+\+\_\+\+DIR\+\_\+\+\_\+)
\item 
\mbox{\hyperlink{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe}{\$servername}} = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLHOST\textquotesingle{}\mbox{]}
\begin{DoxyCompactList}\small\item\em Nome do servidor do banco de dados. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_a7691c0162d89de0b6ba47edcd8ba8878}{\$database}} = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLDATABASE\textquotesingle{}\mbox{]}
\begin{DoxyCompactList}\small\item\em Nome do banco de dados. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_a0eb82aa5f81cf845de4b36cd653c42cf}{\$username}} = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLUSER\textquotesingle{}\mbox{]}
\begin{DoxyCompactList}\small\item\em Nome do usuário. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}{\$password}} = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLPASSWORD\textquotesingle{}\mbox{]}
\begin{DoxyCompactList}\small\item\em Senha do usuário. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_aa0787efab4b22e8a212882f3409d4c77}{\$port}} = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLPORT\textquotesingle{}\mbox{]}
\begin{DoxyCompactList}\small\item\em Porta. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_ac01bf1cf041487498864d054b991f570}{\$protocol}} = \textquotesingle{}TCP\textquotesingle{}
\begin{DoxyCompactList}\small\item\em Protocolo. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_af10158dd74b75f1d337e83102d6b82ce}{\$charset}} = \textquotesingle{}utf8mb4\textquotesingle{}
\begin{DoxyCompactList}\small\item\em Conjunto de caracteres válidos. \end{DoxyCompactList}\item 
\mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}} = new mysqli(\$servername, \$username, \$password, \$database)
\begin{DoxyCompactList}\small\item\em Conexão com o banco de dados. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Conecta com o banco de dados. 

PHP version 5.\+3+

\begin{DoxyAuthor}{Author}
Paulo Roma \href{mailto:roma@lcg.ufrj.br}{\texttt{ roma@lcg.\+ufrj.\+br}} 
\end{DoxyAuthor}
\begin{DoxyCopyright}{Copyright}
2019-\/2022 Paulo Roma 
\end{DoxyCopyright}
\begin{DoxyVersion}{Version}
SVN\+: \$\+Id\$ 
\end{DoxyVersion}
\begin{DoxySeeAlso}{See also}
\href{/cwdc/7-mysql/urna-vercel/api/connect.php}{\texttt{ link}} 

\href{https://www.php.net/manual/en/mysqli.construct.php}{\texttt{ https\+://www.\+php.\+net/manual/en/mysqli.\+construct.\+php}} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
31/07/2022 
\end{DoxySince}


Definition in file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.



\doxysubsection{Variable Documentation}
\Hypertarget{connect-local_8php_af10158dd74b75f1d337e83102d6b82ce}\label{connect-local_8php_af10158dd74b75f1d337e83102d6b82ce} 
\index{connect-\/local.php@{connect-\/local.php}!\$charset@{\$charset}}
\index{\$charset@{\$charset}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$charset}{\$charset}}
{\footnotesize\ttfamily \$charset = \textquotesingle{}utf8mb4\textquotesingle{}}



Conjunto de caracteres válidos. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00051}{51}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}\label{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877} 
\index{connect-\/local.php@{connect-\/local.php}!\$conn@{\$conn}}
\index{\$conn@{\$conn}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$conn}{\$conn}}
{\footnotesize\ttfamily \$conn = new mysqli(\$servername, \$username, \$password, \$database)}



Conexão com o banco de dados. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00054}{54}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_a7691c0162d89de0b6ba47edcd8ba8878}\label{connect-local_8php_a7691c0162d89de0b6ba47edcd8ba8878} 
\index{connect-\/local.php@{connect-\/local.php}!\$database@{\$database}}
\index{\$database@{\$database}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$database}{\$database}}
{\footnotesize\ttfamily \$database = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLDATABASE\textquotesingle{}\mbox{]}}



Nome do banco de dados. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00036}{36}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_a59f6106d84ceb901b027ca96381d59c8}\label{connect-local_8php_a59f6106d84ceb901b027ca96381d59c8} 
\index{connect-\/local.php@{connect-\/local.php}!\$dotenv@{\$dotenv}}
\index{\$dotenv@{\$dotenv}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$dotenv}{\$dotenv}}
{\footnotesize\ttfamily \$dotenv = Dotenv\textbackslash{}\+Dotenv\+::create\+Immutable(\+\_\+\+\_\+\+DIR\+\_\+\+\_\+)}



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00029}{29}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}\label{connect-local_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d} 
\index{connect-\/local.php@{connect-\/local.php}!\$password@{\$password}}
\index{\$password@{\$password}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$password}{\$password}}
{\footnotesize\ttfamily \$password = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLPASSWORD\textquotesingle{}\mbox{]}}



Senha do usuário. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00042}{42}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_aa0787efab4b22e8a212882f3409d4c77}\label{connect-local_8php_aa0787efab4b22e8a212882f3409d4c77} 
\index{connect-\/local.php@{connect-\/local.php}!\$port@{\$port}}
\index{\$port@{\$port}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$port}{\$port}}
{\footnotesize\ttfamily \$port = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLPORT\textquotesingle{}\mbox{]}}



Porta. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00045}{45}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_ac01bf1cf041487498864d054b991f570}\label{connect-local_8php_ac01bf1cf041487498864d054b991f570} 
\index{connect-\/local.php@{connect-\/local.php}!\$protocol@{\$protocol}}
\index{\$protocol@{\$protocol}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$protocol}{\$protocol}}
{\footnotesize\ttfamily \$protocol = \textquotesingle{}TCP\textquotesingle{}}



Protocolo. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00048}{48}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe}\label{connect-local_8php_ad79b54e31bd1050001133c4d70f850fe} 
\index{connect-\/local.php@{connect-\/local.php}!\$servername@{\$servername}}
\index{\$servername@{\$servername}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$servername}{\$servername}}
{\footnotesize\ttfamily \$servername = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLHOST\textquotesingle{}\mbox{]}}



Nome do servidor do banco de dados. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00033}{33}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

\Hypertarget{connect-local_8php_a0eb82aa5f81cf845de4b36cd653c42cf}\label{connect-local_8php_a0eb82aa5f81cf845de4b36cd653c42cf} 
\index{connect-\/local.php@{connect-\/local.php}!\$username@{\$username}}
\index{\$username@{\$username}!connect-\/local.php@{connect-\/local.php}}
\doxysubsubsection{\texorpdfstring{\$username}{\$username}}
{\footnotesize\ttfamily \$username = \$\+\_\+\+ENV\mbox{[}\textquotesingle{}MYSQLUSER\textquotesingle{}\mbox{]}}



Nome do usuário. 



Definition at line \mbox{\hyperlink{connect-local_8php_source_l00039}{39}} of file \mbox{\hyperlink{connect-local_8php_source}{connect-\/local.\+php}}.

