started work on mysql connector
This commit is contained in:
@@ -20,6 +20,7 @@ RENDER()
|
||||
<li><a href="dtree.uce">DTree</a></li>
|
||||
<li><a href="json.uce">JSON</a></li>
|
||||
<li><a href="memcached.uce">Memcached</a></li>
|
||||
<li><a href="mysql.uce">MySQL Connector</a></li>
|
||||
</ul>
|
||||
<pre><?= var_dump(context->params) ?></pre>
|
||||
</>
|
||||
|
||||
@@ -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>
|
||||
|
||||
}
|
||||
@@ -20,6 +20,8 @@ body {
|
||||
max-width: 1024px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
font-family: Tahoma, Helvetica, Arial;
|
||||
font-size: 1.2em;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user