mysql access by html5

<script type=”text/javascript”>
var db=openDatabase(‘mydb’,’1.0′,’Test DB’,2*1024*1024);
var msg;
tx.executeSql(‘CREATE TABLE IF NOT EXISTS h (id unique,log)’);
tx.executeSql(‘INSERT INTO h(id,log) VALUES(3,”hello”)’);
msg='<h1>OK value is added</h1>’;
document.querySelector(‘#status’).innerHTML= msg;
tx.executeSql(‘SELECT * FROM h’,[],function(tx,result){
var len=result.rows.length, i;
msg=”<p>Fount data”+ len +”</p>”;
document.querySelector(‘#status’).innerHTML += msg;
msg=”<p><b>”+ result.rows.item(i).log +”</b></p>”;
document.querySelector(‘#status’).innerHTML +=msg;


<div id=”status” name=”status”>Status Message</div>



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s