\doxysection{connect.\+php}
\hypertarget{connect_8php_source}{}\label{connect_8php_source}\index{api/connect.php@{api/connect.php}}
\mbox{\hyperlink{connect_8php}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00001}00001\ <?php}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00002}00002\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00024}00024\ \mbox{\hyperlink{connect_8php_ad79b54e31bd1050001133c4d70f850fe}{\$servername}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLHOST'}];}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00025}00025\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00027}00027\ \mbox{\hyperlink{connect_8php_a7691c0162d89de0b6ba47edcd8ba8878}{\$database}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLDATABASE'}];}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00028}00028\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00030}00030\ \mbox{\hyperlink{connect_8php_a0eb82aa5f81cf845de4b36cd653c42cf}{\$username}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLUSER'}];}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00031}00031\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00033}00033\ \mbox{\hyperlink{connect_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}{\$password}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLPASSWORD'}];}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00034}00034\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00036}00036\ \mbox{\hyperlink{connect_8php_aa0787efab4b22e8a212882f3409d4c77}{\$port}}\ =\ \$\_ENV[\textcolor{stringliteral}{'MYSQLPORT'}];}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00037}00037\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00039}00039\ \mbox{\hyperlink{connect_8php_ac01bf1cf041487498864d054b991f570}{\$protocol}}\ =\ \textcolor{stringliteral}{'TCP'};}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00040}00040\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00042}00042\ \mbox{\hyperlink{connect_8php_af10158dd74b75f1d337e83102d6b82ce}{\$charset}}\ =\ \textcolor{stringliteral}{'utf8mb4'};}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00043}00043\ }
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00045}00045\ \textcolor{keywordflow}{try}\ \{}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00046}00046\ \ \ \ \ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}\ =\ \textcolor{keyword}{new}\ mysqli(\mbox{\hyperlink{connect_8php_ad79b54e31bd1050001133c4d70f850fe}{\$servername}},\ \mbox{\hyperlink{connect_8php_a0eb82aa5f81cf845de4b36cd653c42cf}{\$username}},\ \mbox{\hyperlink{connect_8php_a607686ef9f99ea7c42f4f3dd3dbb2b0d}{\$password}},\ \mbox{\hyperlink{connect_8php_a7691c0162d89de0b6ba47edcd8ba8878}{\$database}},\ \mbox{\hyperlink{connect_8php_aa0787efab4b22e8a212882f3409d4c77}{\$port}},\ \mbox{\hyperlink{connect_8php_af10158dd74b75f1d337e83102d6b82ce}{\$charset}});}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00047}00047\ \}\ \textcolor{keywordflow}{catch}\ (Exception\ \$e)\ \{}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00048}00048\ \ \ \ \ echo\ \textcolor{stringliteral}{"{}Caught\ exception:\ \{\$e-\/>getMessage()\}\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00049}00049\ \}\ \textcolor{keywordflow}{finally}\ \{}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00050}00050\ \ \ \ \ \textcolor{comment}{//\ Verifica\ a\ conexão}}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00051}00051\ \ \ \ \ \textcolor{keywordflow}{if}\ (!isset(\mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}})\ ||\ \mbox{\hyperlink{connect-local_8php_aa8a5a87b9c1a6a0819b88447cbe41877}{\$conn}}-\/>connect\_error)\ \{}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00052}00052\ \ \ \ \ \ \ \ \ die(\textcolor{stringliteral}{"{}\ -\/\ probably\ Railway\ credits\ are\ over!!"{}});}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00053}00053\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{connect_8php_source_l00054}00054\ \}}

\end{DoxyCode}
