I’m creating an iPhone app that uses UIWebView, I have a MySQL database with 7 tables and about 100 rows in each table. I want to avoid using PHP so that I can locally load the html file into my app using:
[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];
rather than an external URL…
I’ve exported the MySQL database, and formatted all the information into a SQLite database.
Is there a way to add the database into my Xcode project, and then query the data into my HTML file without having access to the internet?
Clarification, is there a localized, offline alternative to:
<?php
include("connect.php");
$variable = mysql_query("SELECT * FROM table ORDER BY name");
?>
Essentially, I’m looking for an ALL jQuery approach so that my application doesn’t require internet!
Thanks!
For anyone that comes across this post, I ended up using
.getJSON()with a local.jsonfile.I included the json file with:
<script type="text/javascript" src="data.json"></scipt>and then used the
getJSONcalls where needed! It works perfectly without internet!