3

I'm trying to write an iOS app using Xcode.

A simple login prompting username and password.

I have no idea how to open a database connection to validate the username and password.

The database I use is mysql.

I tried using this link http://macbug.org/macosxsample/mysql#.Ur8AYBbtGPF

but I get an error when I tried to add libmysqlclient.a to the frameworks and library.

1
  • yes, its on the sql server, oh this is my first time creating an app.How would i write a web service? Thanks for your input. Commented Dec 28, 2013 at 17:21

2 Answers 2

1

If your database is on a server somewhere, then you would generally not have your iOS app interact directly with the database server, but rather you would write a web service that the app would interact with (via NSURLConnection, NSURLSession or something like AFNetworking), and the web service would interact with the MySQL database.

In terms of how to write a web service, often, when people are writing their first web service, they'll use some simple technology like PHP. Do you know what options you have on your server? If PHP is an option, then you can check out Ray Wenderlich's How to Write a Simple PHP/MySQL Web Service. Then check out How to Write an iOS App that Uses a Web Service.

Sign up to request clarification or add additional context in comments.

1 Comment

It may be an option ... I'm using mysql workbench, browser and administrator. I'll check it out, thank you.
0

You should use SQLite instead of MySQL for iOS application. You are referring MacOSX application tutorial. try this http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.