uce/test/mysql.uce
2021-11-27 14:11:47 +01:00

37 lines
763 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
}