Sam Croft

Full-stack developer

Posting data from a PhoneGap app to a server using jQuery


Filed in: android, forms, iOS, jQuery, MySQL, PhoneGap, php

Recently I’ve had several requests to create an article about posting data to a server from a PhoneGap app so I thought I’d cover the steps I go through when dealing with this kind of requirement.

The method is extremely simple providing a few important steps are followed.

Important: Although not necessary, the context of this article will be better understood if you have read my previous article, Updated: loading external data into an iOS PhoneGap app using jQuery 1.5.

The reference to landmarks throughout this article refers to a barebones app I created in the aforementioned article where I was listing the geo-coordinates of several well known UK landmarks.

Creating an iOS PhoneGap app with Xcode 4

The first step is to create a new iOS PhoneGap app. Open the project location in finder, create your www folder and add it to the project in Xcode. You will also need the phonegap.js file if one isn’t already built when you compile. Make sure you use the corresponding version for your version of PhoneGap—I’m using phonegap-1.2.0.js.

Although I’m using iOS as the example, the project www files would be the same for Android and indeed any other supported platform.

Creating the form to post data from

Continuing with the example I created in my article about loading data from a server in a PhoneGap app, where I was loading geo coordinates for a few famous UK landmarks, I can expand on this and add a form for each landmark to submit data back to the server.

A simple comments form

I’m going to use a really simple form for each landmark so users can leave a comment about it.

<div id="landmark-1" data-landmark-id="1">
		<label for="email">
			<input type="email" id="email" name="email">

		<label for="comment">
			<textarea id="comment" name="comment" cols="30" rows="10"></textarea>
		<input type="submit" value="Save">

I have used my preferred method of form markup.

Note: the intended use of this markup is that it is generated, or at least made visible, when a user taps an ‘add comment’ button. When this function is called the id for the landmark the user is commenting on is in the parent div as an id and custom data attribute. It could also be a hidden form field, but seeing as the id for the landmark is already available this seems unnecessary bloat.

How you go about integrating this is entirely based on your app and what fits best, I am merely mentioning what fits best with my landmarks app.

Using jQuery to handle and post form data

As with my previous articles I’m going to use jQuery for the JavaScript library but it’s worth mentioning that something like xui.js may be more suitable if you’re trying to create an app with as small a footprint as possible.

Using the .submit() event handler

While not necessary, it’s certainly considered correct to use jQuery’s .submit() event handler rather than an HTML button or link when dealing with forms.

A basic function assigned to the .submit() event handler:

	var landmarkID = $(this).parent().attr('data-landmark-id');
	var postData = $(this).serialize();
		type: 'POST',
		data: postData+'&amp;lid='+landmarkID,
		url: '',
		success: function(data){
			alert('Your comment was successfully added');
		error: function(){
			alert('There was an error adding your comment');
	return false;

There are three important things going on in this function:

Line 2: firstly, I am grabbing the id for the landmark that is being commented on. I’m accessing this value from the custom data-landmark-id attribute in the parent div element.

Line 3: secondly, I am using jQuery’s serialize() method to gather all the data and values from the form. This is somewhat easier than stepping through each field and using the val() method. If I was to log the postData variable the output would be something like; like this location!

Lines 5-15: finally, I am using jQuery’s ajax() function to POST the data to a server. A successful POST will trigger one function while an error will trigger another.

This is the foundation for posting form data from a PhoneGap app.

Note: if you are creating your forms on-the-fly then you will need to use the live() event handler with your submit() event handler.

Using PHP to create a server-side component to store the data

My previous article about loading data from a server used PHP and MySQL so I’m going to continue with the same example and build on the database.

Creating a table to store the comments

First I’m going to create a small table that will contain all of the submitted comments.

CREATE TABLE `comments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `location_id` int(11) DEFAULT NULL,
  `email` varchar(45) DEFAULT NULL,
  `comment` text,
  PRIMARY KEY (`id`)

This is fairly self explanatory. I’m going to store the email address, comment and the location id.

Creating a tiny PHP script to handle and store the comments

The next part of submitting a comment is to create a PHP script that takes the data from the app, sanitises it and stores it in MySQL.

$server = "";
$username = "";
$password = "";
$database = "";

$con = mysql_connect($server, $username, $password) or die ("Could not connect: " . mysql_error());

mysql_select_db($database, $con);

$locationID = $_POST["lid"];
$email = mysql_real_escape_string($_POST["email"]);
$comment = mysql_real_escape_string($_POST["comment"]);

$sql = "INSERT INTO comments (location_id, email, comment) ";
$sql .= "VALUES ($locationID, '$email', '$comment')";

if (!mysql_query($sql, $con)) {
	die('Error: ' . mysql_error());
} else {
	echo "Comment added";


Lines 1-4: set up database connection details.

Lines 6 & 8: connect with the MySQL server and select the database that will be used.

Lines 10-12: grab the POSTed form data from the PhoneGap app and sanatise any strings.

Lines 14-21: create a string with an SQL insert query and then execute the query. Return a success or error message.

Line 23: close the MySQL connection.

Testing the app in the iPhone simulator

The final step is to build and compile the app and see how it works in the iPhone simulator. Bear in mind a couple of things and a common oversight and you’ll be submitting data to your server with no problems.

An iOS PhoneGap app showing the confirmation message of a comment being sent to a server
If all goes well, you should see this alert box when you submit a comment.

Console logging is your friend

You’ll notice in the js function that I have a couple of console.logs that return the status of the comment save. These are great when you’re testing in your browser as you can see them in the developer console. And they also appear in the Xcode debug console (shift+cmd+c), so use them to step through your code if you are having issues.

Add your server to your app’s server whitelist

With PhoneGap 1.0 came the addition of server whitelists whereby you must declare any external hosts that you will be accessing data from or sending data to.

To add your server as an external host; view the PhoneGap.plist in Xcode (project navigator > project > supporting files) and add a new item within the ExternalHosts array for your server. In this example I’m using localhost so I’m going to go ahead and add a string value of localhost.

Because I’m using localhost I’m also going to add another string value – This explicitly states I am in debug mode, rather than release.

If I was using my own website as a data server I would add a string value of and drop the value.

This is just the basic outline

One final note is that this is just the basic outline in submitting data to a server from a PhoneGap app. Utilising this further you would have to consider how best to integrate with your app, create client and server side validation, have loading gifs, visually handle a complete form submission and maybe trigger a function that gathers the new data and appends it to any existing data already visible. I will cover all of this in another article if there is any interest.

About the author

I'm Sam Croft a full-stack developer with over 15 years experience in web and app development. For the last six years I have been a partner of Running in the Halls, an app and game design studio based in Huddersfield, UK. During this time I have developed many web and applications. Highlights include a node.js/ app to create the worlds largest crowd-based game on the first series of Channel 4's Gadget Man with Stephen Fry and Librarygame, a Library gamification platform for Universities. Librarygame is being played by over 6,000 students at The Open University, The University of Manchester, The University of Glasgow and The University of Huddersfield.

In my spare time I enjoy long distance running, watching all sports (especially F1) and playing video games. I live in the Holme Valley in West Yorkshire with my wife, Alex.

Sometimes I tweet.

  • Great post! Might be a stupid question as i’ve quickly read it, but can you post data via https with this method. 

  • Sam Croft

    Should work absolutely fine, Chris. Not tried it with POST but works OK with GET.

  • Sam Croft

    And thanks for the kind words :)

  • Pingback: Updated: loading external data into an iOS PhoneGap app using jQuery 1.5()

  • asics64

    How about including image ?can i use the same method ?

    E.g (sending email,comments and image to the remote sql svr)

  • Anonymous

    This is entirely possible yes.



  • asics64

    Hi Sam, Thank for your advice. But i am current using: SQL Server and asp on server side. 

    And i intend to send, email,comments and image together to my sql server via asp. But the save button does not seem to trigger the form function

  • asics64

    do you have advice on this kind of work around? I does not seem to get the data to my remote server

  • Anonymous

    What kind of error are your receiving if you run this in your browser and check the console?

  • asics64

    i finally got to post the image over to the server. I saw that we can add in optional parameter as well. But how does we see that in the php ?

  • In your php you could try

    This will return an array of all of the $_POST variables. It’s a good way to debug if you’re posting a lot of things, rather than stepping through each one on at a time.

  • Jayeshnmbr

    Hi sam

    congratulations for the great post. i have a small doubt here.
    i am trying to develop small windows mobile app to upload images from
    the phone to my remote server, and i am using windows phone sdk 7,phone
    gap and i am trying to upload images using php script.writh
    now i am able to access the camera and library but cant upload the
    file.please help me


  • Adam Reimer

    Quick question: Is it possible to remove the “index.html” line from the top of the alert? I’d rather my users not see that

  • Yes, it is. The method above was just a quick and easy way to demonstrate it working and ensure you would be able to test it in a browser.

    For production you can use the PhoneGap notification alert function, which fires off a native alert

  • Craig

    Another great quick tutorial, thank you Sam.  Works like a charm.  Any time to show a simple validation of the form fields and redirection if form field posts match a database entry, such as email / password?  Thanks!

  • Thanks Craig. I’ll certainly cover those aspects in a future article.

    Have you considered using HTML5 validation? It’s pretty cool what you can do with it:

  • Pingback: I T | Pearltrees()

  • Sam,

    thnks 4 this post.
    I have a problem…
    When i press submit button, index.html is refresh. and mysql is empty.
    i try in web browser, and in ‘url bar’ show some like this –>
    and my database is empty :(

    Any help please :)

    (sry 4 my english.)

  • Gmeyers

     Same problem here… but it works on macBook Safari. Any Ideas?

  • Some questions:

    When you are testing in the browser – are the js and php files on the same domain? It will not work cross-domain unless it is from within your PhoneGap app.Open the developer console in your browser and see if there are any errors in the console log. Also, check the network tab and see if the php file is being called correctly. This should help you determine what isn’t working.Let me know what happens.

  • So it works in Safari, but not in your PhoneGap app?

    Are there any error messages in the Xcode console log?Did you add your domain to the server whitelist in your app plist?

  • Gmeyers

     GOT IT! my whitelisted domain was being rejected for some reason. I found this article here Need to add this to the whitelist entry * Thanks for the post. The best tutorial on the entire web… I’ve looked at them all I believe. CHEERS!

  • Geetha

    When testing this app i got the following error
    PostData2Server[1006:13403] [INFO] Error in success callback: NetworkStatus0 = TypeError: ‘undefined’ is not an object
    Please help me to solve this

  • What version of PhoneGap/Cordova are you using? 

    I think you might be having a conflict with jQuery and the onDeviceReady function. Try this method of how to use jQuery with PhoneGap

  • Ettore Manetti Ink

    a genius, as always

  • Too kind, thank you!

  • Ganesh

    could you suggest me  the code for connecting the server  for android in phonegap ?please..

  • The HTML, JS and PHP would all be the same for an Android app. The only thing different would be PhoneGap project itself. 

    I will try and update the Git repository so that it includes and Android version as well, when I have some time. 

  • Nagella Ranjith

    Hi Sam,
    I followed your tutorial and i hope it’s same for cordova based applications. I used cordova 1.8.0.js file instead phone gap-1.2.0.js file. But when i submit the comment there is no action taking place. I m not seeing any console error. and more over when i am running a prompt box is opening and it is “Dveloper Tools Access needs to take control of another process for debugging t continue. Type the name and password of a user in the “Developer Tools” group to allow this.”.

    is the above prompt making demo not working ??

    Thanks & Regards

  • Nagella Ranjith

    Hi Sam, I figured out the problems. Thanks any way..!!

  • Glad you sorted it, Nagella. You should share how you fixed it – someone else might have the same issue.

  • Puneet

    Hi Sam 

    Can You Provide some help on sending images to amazon s3 using phonegap

  • Silko

    Sam thanks for the great post. Are we able to also post Geolocation information as well and would we place this like the landmark ID ?

  • Madhulika

    I have researched everywhere and found that apparently Phonegap cant process php.
    However here you have used php.
    I want to know how does one post data to a server (say, localhost, on my pc) from a phonegap web application using json?
    Your previous article was about loading data from a server using json, but i want to know how to ‘post’ the same. As in how to INSERT INTO table … etc using json.
    Thank you.

  • Madhulika

    Also, i found that the php file needs to be hosted on a server to be able to be processed by phonegap.
    I dont know how to do that. How do i make localhost (im using xampp) ‘host’ my .php file?
    I will ab really glad if you could help. :)

    Great tutorial by the way!

  • ranjith kumar
  • Hi Madhulika,

    This article is all about posting data from a PhoneGap app to a server. It covers each step.

    – Sam

  • If you’re using XAMPP (I use that too), then make sure Apache and MySQL are running, create a directory in your xampp > htdocs folder and place the php in there. Edit the settings to make sure everything is right for your setup. Create the database using the SQL code above and you’re set to go…

  • Madhulika

    Thank you so much!! :)

  • Madhulika

    Yes it is helpful indeed.
    Thank you very much for taking time. :)

  • ranjith kumar

    Its Great..!! It was my first post ever. Thank you so much for your appreciation.

  • Hi Silko,

    Absolutely. This would be quite straightforward, you just need to hook into PhoneGap’s Geo Location object –

  • David Hernández

    is possible to have a form where I can upload images to my mysql database?. 


  • Francis

    Hi Sam

    Very nice tutorial. I seem to lack the needed skills though. I could set up all the hings all right and when I post the form nothing happens the page just sweeps to the left and reloads, but no alert shows up. Here what I did: I just added the function in a tag within the same page as the form in the header tag. Yet the function doesn’t sem to be called at all. Stupid question: Do I have to create an external js file for the function an include it? shouldn’t make a difference right).

    Thanks for help

  • Francis

    Hi Sam, I could resolve it. It was a stupid character transformation issue when copy/pasting your code > the single/double quotes around the $(“form”). function part. It now works like a charm.


  • Hi Francis,

    Glad you managed to sort this. Let me know if you run into any further issues.

    – Sam

  • I have the same problem. It’s won’t work with cordova.

  • Hi!
    Like Nagella Ranjith said, I does not work with Cordova. Do you have a fix?

  • ranjith kumar

    Hi Simon, I used one of my lab computer, where I don’t have access to developer tools which I sort with the help of my Administrator. The problem was I don’t have access to developer tools, the system administrator has to login with his credentials. This way you can sort the above problem.

  • Arpit

    Hey Can I use the
    http://localhost:8081/pgap/index.htm type of url string while connecting via Android emulator….!!!please help me ……

  • Pingback: My article for Adobe’s Appliness magazine: Loading data into, and posting data from, a PhoneGap app()

  • Rob

    Hi Sam, wonderful post, I have found this article and the article about loading data from a mysql database into a phonegap app extremely helpful. I do have a problem however, and I wonder if you could help me. I am trying to post a search query to my database from phonegap and here in this demo you use the INSERT command. How can I get this to work with the search command? What I mean is, how do I search my database from a form and then display the results gathered using JSON. Any help would be greatly appreciated. Keep writing.

  • Thank you very much!

  • marc

    y u not use facebook?

  • tomassi

    i got: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”’,”)’ at line 1

  • thomas

    problem was that $locationId did not have ‘ ‘ quote marks >>> “VALUES(‘$locationID’, ‘$email’, ‘$comment’)”;

  • Hi Thomas,

    This could have been because your locationid field in your database was not an INT. If it is a varchar it would need quotes yes, as it would be expecting a string. An INT column would not require quotes. Maybe that was the issue here?

  • Pingback: Phonegap Tutorials « PHPsolutionBD()

  • Rajanikanth

    Really good ……

  • harsh sharma

    nice article, can you please post some more articles, create client and server side validation, have loading gifs, visually
    handle a complete form submission and maybe trigger a function that
    gathers the new data and appends it to any existing data already visible.

  • Chris J.

    Thanks Sam for posting this. I has really helped me! I have run into a problem that I can’t seem to figure out, I am sure I am doing something wrong on my end. I have followed the steps above but when I submit my form it just refreshes the page. I do not get a success or fail notification. I have specified my server in the .plist file. I have also tested my server file which connects to the db and that works fine. Since I do not get a message when I submit I assume that my error is in the form or function before it even tries to access the file on the server.

  • Hi Chris,

    Are you seeing anything in your javascript console (if testing in browser) or in xcode’s console? If you’re using the iPhone simulator you can open Safari and then debug your application with Safari’s debug tools (see

    This should highlight what is going on…

  • Chris J.

    No errors are coming up in Xcode or in Safari. I am running the iPhone simulator 6.0. Would it make a difference whether the function is called from an external page or on the same page as the form? I wouldn’t think so but just being sure. Thanks so much for your help!

  • Chris J.

    Doh, I forgot to add the body onload. It is working now. I feel silly. Thanks for the great tutorial Sam.

  • Easily done. Glad it’s all working now :)

  • wahdan kedai

    is it possible to use the script for android apps?

  • Hi Wahdan,

    Absolutely. This is why PhoneGap is so good, you write the same HTML and JavaScript and use it on different devices.

  • phil1983

    Hi Sam,

    found your blog searching for “phonegap form validation”. Thanks for your article. I’m new to phonegap and it really helped me.

    In “This is just the basic outline” you offered to write another article with detailed form validation, loading gifs, ….

    Did you write the offered article?

    Greetings from Germany.

  • Hi Sam

    Firstly thanks for taking the time out to write this :-0

    I’ve tried implement my own version of this but something is wrong and I’m not sure what. I no my database is working but the code from my form doesn’t seem to be getting through.

    Can you give me some advise please.

    I think it’s something wrong with the javascript side of things but I have know idea what.

    Please help

    This is my index.html form that I want to send: (Clientside)

    Phone Number

    First Name

    Last Name

    Current Date

    Current Time

    This is the post.js script I’m using to send the form: (Clientside)

    i$(document).bind(‘deviceready’, function(){
    var sendData = $(this).parent().attr(‘sendInfomation’);
    var postData = $(this).serialize();

    type: ‘POST’,
    data: postData + ‘&lid=’ + sendData,
    //change the url for your project
    url: ‘’,
    success: function(data){
    alert(‘Your comment was successfully added’);
    error: function(){
    alert(‘There was an error adding your comment’);

    return false;

    and this is the save.php script (Serverside):

    $phoneNumber = mysqli_real_escape_string($_POST[“phoneNumber”]);
    $firstName = mysqli_real_escape_string($_POST[“firstName”]);
    $lastName = mysqli_real_escape_string($_POST[“lastName”]);
    $currentDate = mysqli_real_escape_string($_POST[“currentDate”]);
    $currentTime = mysqli_real_escape_string($_POST[“currentTime”]);

    = “INSERT INTO member (phoneNumber, firstName, lastName,
    profilePicture, photo, video, textMessage, callData, activityData,
    latitudePos, longitudePos, currentDate, currentTime) VALUES
    (‘$phoneNumber’, ‘$firstName’, ‘$lastName’, ‘$profilePicture’, ‘$photo’,
    ‘$video’, ‘$textMessage’, ‘$callData’, ‘$activityData’, ‘$latitudePos’,
    ‘$longitudePos’, ‘$currentDate’, ‘$currentTime’)”;

    $sql =
    “INSERT INTO member (phoneNumber,firstName, lastName, currentDate,
    currentTime) VALUES (‘$phoneNumber’, ‘$firstName’, ‘$lastName’,
    ‘$currentDate’, ‘$currentTime’)”;

    if (!mysqli_query($connection, $sql)) {
    die(‘Error: ‘ . mysqli_error($connection));
    } else {
    echo “Comment added”;


  • hardsolidman

    i have an android project… i tried to display data from localhost using json and php, and it work… then i want to insert some additional data using ajax its like
    $(‘#submit’).click(function() {
    type: “POST”,
    url: “http://localhost/mysql/save.php”,
    data: {‘form’: $(“#saveForm”).serialize(), ‘other’: extra_data},
    success: function(data)
    but it doesnt work
    any advice…?

  • Only just seen this comment. What errors are you seeing in the console log? Try changing the click event for your submit button to the submit event. $(‘#submit’).submit(function(){…..

  • Jedd

    is this would work on the jquery ajax shorthand methods? (e.g. $.post)

  • Kunchit Surachon

    I send data with ajax() to php file on server same as your code ,but data not send to php file

  • pixel

    Thank you I followed your article and it works fine and inserted data in database, however error function always fired even though( php code succeed in adding data in database).

    I tried to trace the error using firebug, the status is (200 OK), however during processing the ajax I notice the php url in red and status is 407, once it done, the status become 200 OK.

    Using jquery-1.10.2, cordova 2.9.0

  • Alex Christensen

    DO I need to create a table or anything? I’m really confused. I’m building this app in PhoneGap with jquery mobile and trying to connect this to my database and nothing happens.

  • Kiran Kyasa

    What should I do if I want retrieve the data back to the Phonegap app. ??

  • Thank you so much for posting this! I was looking around all over the internet for info on submitting form values into a database with AJAX and phone gap, and this was the most clear resource on how to do it. I am now up and running. One thing, though: in your PHP section, the following two lines of code are displayed for the SQL insert:

    $sql = “INSERT INTO comments (location_id, email, comment) “;
    $sql .= “VALUES ($locationID, ‘$email’, ‘$comment’)”;

    Shouldn’t it just be this?

    $sql = “INSERT INTO comments (location_id, email, comment)
    VALUES ($locationID, ‘$email’, ‘$comment’)”;

    I’m still kind of new to all of this, so maybe you had a reason for doing that. Thanks again for posting!

  • Hi Paul,

    Glad this has helped you. I’m actually in the process of writing some more up to date versions of these Phonegap articles.

    You’re right about the SQL, it could just be like that. I believe I split it into two lines as there was an issue with the length of code in the preview. But you will see it sometimes, some people (I think it’s a legacy of ASP code) like to separate the values on a separate line. Both ways are absolutely fine.

    Thanks for your comment :]

  • Got it. Thanks again, Sam!

  • Nehul Agrawal

    Awesome tutorial. It helped very much. But when when i want to fetch data?

  • Thank you, Nehul. Sure – check this article it needs updating but the core functions are still the same.

  • Pingback: Using CodeIgniter as the backend for PhoneGap app developing | Portfolio - YOYU()

  • Abhishek Gupta

    good post it’s…could you please explain all of the steps included in connecting a phonegap app(for android) to database(from basics)…i’m new to this technology…so i would be obliged if you help me…thanx in advance…

  • Pingback: PhoneGap submitting JSON form information controlling Jquery .ajax - Adan()

  • Chathura Lakmal

    Hi, Im new to phonegap and i downloaded the project and edited. but its not working.

    i have submitted question to StackOverflow but no answer

    Please help me. do i need to update libraries because of this project little older (2012)?

  • Sravan Kumar N

    Does it support custom headers

  • Super_Mx

    Code works okay on emulators and browsers. The problem is in the form tag the in the example above doesnt have the type=”post” in it eg at least that worked for me. My issue is after it is compiled into a mobile application it doesnt work. I use intel xdk, in the intel xdk emulator the code works but after code is compiled into an apk file and is installed on an andriod device, it does nothing, no notifications, no pop ups, no database entry. Need help to fix this or is this code strictly for web not android application?

  • Rodrigo Nascimento

    Nice article with step-by-step.
    It’s really simple make a request with phoneGap, pure jquery!

    Thanks dude! (:

  • Henry Finn

    top article, good stuff

  • William

    Hi Sam, I’m trying to post some data and I’m getting an error from my query form function saying “Uncaught ReferenceError: $ is not defined”. Can you please help me. Thank You

  • William

    Hi Sam, I’m trying to post some data and I’m getting an error from my query submit form function saying “Uncaught ReferenceError: $ is not defined”. Can you please help me. Thank You

  • Which back end tool you use to read the data which you got from the app…
    i was wondering if i give multiple section of feedback
    How can i get easy access to my data.
    do i have to write the php code to create a php back-end panel for myself
    or is there any wordpress commets section or thunderbird like tool which we can use to check the data..

  • Slinky

    Extremely helpful! I’m just getting started with phonegap, and this got me running just fine. Thanks!

  • Gilles GARCIA

    Great Great Post. As I beguin to work with Cordova/PhoneGap, it’s great to see your example. Thanks a lot Sam !

  • naresh

    how to stop alert box in index.html name

  • kannan

    Hi sam, iam completely new to cordova, started exploring them. i created simple registration form with html. please give a steps to store them in server using javascript (instead of php). my email id is Thank you

  • rabiee3

    Great Post!!! and a very simple explanation. however i’m little worries about the security

  • ENSASKE17 .

    Thx, this helped me a lot! im starting an app, i was lost. Also this give me some ideas to create a rest api with codeigniter.

  • Sarah

    Just wanted to say thanks for a great tutorial. Got tripped up by referencing a local version of the php script but after checking your source code I realised it needed to be hosted somewhere and POW it works now. Thanks again.

  • haizad

    I have one question, how to change the mysql code given into mysqli?

    Big thanks.

  • Daniel E. Speckman

    How do you solve a mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ ”, ”)’ at line 1

    I know i’m connected to my database, but can’t get past this!

    Here is my appended code from your tutorial with my user database privileges for testing: