started work on mysql connector

This commit is contained in:
Udo Schroeter
2021-11-27 14:11:47 +01:00
parent 4766d33fdd
commit 19ebedc2fe
11 changed files with 267 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
RENDER()
{
<html>
<link rel="stylesheet" href='style.css?v=1'></link>
<h1>
<a href="index.uce">UCE Test</a>:
MySQL Connector Test
</h1>
<label>MySQL Connection</label>
<pre><?
string query = "SELECT * FROM :table WHERE x = :val";
StringMap params;
params["table"] = "TableName";
params["val"] = "Dubious\\Value'Name\nwith;breaks";
MySQL con;
if(con.connect("localhost", "root", "q831b197f"))
{
echo("connection established\n");
echo("error: "+con.error()+"\n");
echo("quotation test: "+con.escape("\"' or 1=1;.")+"\n");
echo("query parse: "+con.parse_query_parameters(query, params)+"\n");
}
?></pre>
<label>CGI Params</label>
<pre><?= var_dump(context->params) ?></pre>
</html>
}