Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering jQuery Mobile

You're reading from   Mastering jQuery Mobile Design and develop cutting-edge mobile web applications using jQuery Mobile to work across a number of platforms

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781783559084
Length 262 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started FREE CHAPTER 2. Tools and Testing 3. Mobile Design 4. Call to Action – Our Main Project 5. Navigation 6. Controls and Widgets 7. Working with Data 8. Finishing Touches 9. The Next Level 10. Mobile Best Practices and Efficiency Index

A dab of PHP


Before we start writing any code, let's set up a few simple things:

  1. Let's create a new folder named JQMData in the htdocs folder in our XAMPP folder. Look for your XAMPP folder in your default installation drive on Windows or the Applications directory on Mac, if you have your XAMPP installed at the default location.

  2. Now, copy the index.html file from the previous chapter and paste it into this JQMData folder.

  3. Rename this file from index.html to index.php.

  4. Create a new file and name it db.php.

If you have followed the steps correctly, you should see our application when you fire up this URL in your browser: localhost/JQMData.

We are now ready to write our first PHP code for this application. Open up the db.php file that we have just created. We have to now establish a connection to the MySQL database that we have created. Let's see how this works. Copy the following code to db.php file and save it:

<?php
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image