37 lines
763 B
Plaintext
37 lines
763 B
Plaintext
|
||
|
||
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>
|
||
|
||
}
|