Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
[HELP!!!] Newbie for app develop... (a bit long post)
hi all, I am a newbie for iPhone app develop and now I have to create an iPhone app for my project which about in-house restaurant ordering system. For my project, I had set up a local server (Linux + apache + phpMyAdmin + MySQL) to handle the database data and for the iPhone app, it should be used to get the data from the database and add data to the database. p.s: My server and iPhone are placed in the same network for communication and linked up with a router.
At this moment, I have created the interface for my iPhone app only. The first page is for waiter to enter the customer number and table number for further functions, then it will push to the main page with several tabs below for different pages like menu(for placing the order from the customer) and orderList(according to customer no. to the corresponding order list).
My questions are how can my iPhone app connect to my local server, especially the database? Is it possible to use PHP script to communicate with the server to get/modify the database data from my app and return the data by XML to my app (if possible, how can I do so)? Is my approach for this app develop correct? (iPhone app -> local web server -> database) As I have mentioned above, the first page is prompt waiter to enter customer's info, can I use that info to get the data from the database and how? (customer number is unique in the database). Finally, I had googled for long time but I cant get examples for teaching me how to deal with my problem, I hope u guys can post me some source codes for reference.
Sorry for my poor presentation. Hope you guys can understand my problem and help me. Thanks so much :)
hi all, I am a newbie for iPhone app develop and now I have to create an iPhone app for my project which about in-house restaurant ordering system. For my project, I had set up a local server (Linux + apache + phpMyAdmin + MySQL) to handle the database data and for the iPhone app, it should be used to get the data from the database and add data to the database. p.s: My server and iPhone are placed in the same network for communication and linked up with a router.
At this moment, I have created the interface for my iPhone app only. The first page is for waiter to enter the customer number and table number for further functions, then it will push to the main page with several tabs below for different pages like menu(for placing the order from the customer) and orderList(according to customer no. to the corresponding order list).
My questions are how can my iPhone app connect to my local server, especially the database? Is it possible to use PHP script to communicate with the server to get/modify the database data from my app and return the data by XML to my app (if possible, how can I do so)? Is my approach for this app develop correct? (iPhone app -> local web server -> database) As I have mentioned above, the first page is prompt waiter to enter customer's info, can I use that info to get the data from the database and how? (customer number is unique in the database). Finally, I had googled for long time but I cant get examples for teaching me how to deal with my problem, I hope u guys can post me some source codes for reference.
Sorry for my poor presentation. Hope you guys can understand my problem and help me. Thanks so much :)
Have a look at this thread theres a tutorial about interacting with databases:
the linked that posted hodgey87 is not usefull for you.
yes, you can create php methods to do operations in your mysql DB, and you can call these with ASIHTTPRequest or NSURLConnection, you can use POST to add an xml as input.
Maybe you can choose to go making a WebService, but if you are not familiar with that, it's not the best choice.
the linked that posted hodgey87 is not usefull for you.
yes, you can create php methods to do operations in your mysql DB, and you can call these with ASIHTTPRequest or NSURLConnection, you can use POST to add an xml as input.
Maybe you can choose to go making a WebService, but if you are not familiar with that, it's not the best choice.
Yes, I might choose web service for working on my app, but can you give me some ways to follow? what I have to do for both server and iphone side? Thx so much :)
when you want to read something, call a specific php script:
iphone-->php script--DB-->xml--->iphone
and parse with NSXMLParser the xml returned.
when you want to change something in your DB, based on input on your iphone
iphone, create an xml (or something other)--->send in POST to php script---DB--->return "ok" to iphone
to communicate with the script from the iphone (as I already said) use ASIHTTPRequest or NSURLConnection
I have a stupid question, what url should I placed in the URLConnection? my server ip? or other link? or do i need to write a php page link to my db and my url is that php page? thx again :)
You have a previous thread on this, where I helped you debug it. You should bump that thread if you still haven't got it working, and say what the problem is rather than interrupting other peoples threads.
TheFlyingDutchman;306299 said:
Yeah, I'm new to coding in iPhone SDK. But, I want to be able to add a simple textfile to a webserver. I like Flurry for analytics.7
Yes chuntakli2, of course you need to use the link to your php script :rolleyes:
I still hv some questions about web service, wht I hv to do in the server side (LAMP setting with phpMyAdmin), do i need to create a php file in my server that is linking to the database? if yes, how to? then for the iPhone app side, the NSURLConnection should be placed at delegate file or the viewcontroller file?
I still hv some questions about web service, wht I hv to do in the server side (LAMP setting with phpMyAdmin), do i need to create a php file in my server that is linking to the database? if yes, how to? then for the iPhone app side, the NSURLConnection should be placed at delegate file or the viewcontroller file?
thx a lot again...
I am trying to do similar thing for my app, i have to connect my app to local server and interact with it. Can you please give me sample code of your application?
Replies
Have a look at this thread theres a tutorial about interacting with databases:
Sqlite tutorial
Might be of some use.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeyes, you can create php methods to do operations in your mysql DB, and you can call these with ASIHTTPRequest or NSURLConnection, you can use POST to add an xml as input.
Maybe you can choose to go making a WebService, but if you are not familiar with that, it's not the best choice.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeiphone-->php script--DB-->xml--->iphone
and parse with NSXMLParser the xml returned.
when you want to change something in your DB, based on input on your iphone
iphone, create an xml (or something other)--->send in POST to php script---DB--->return "ok" to iphone
to communicate with the script from the iphone (as I already said) use ASIHTTPRequest or NSURLConnection
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI am not sure that ASIHTTPRequest is the best way, but it is definitely an option.
To add data to a database, it would look somewhat like this:
iphone --> php script --> database --> same php script (with echoed result) --> iphone (result received, if an error alert the user).
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethx again :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomehowever you haven't added more than i said :)
Yes chuntakli2, of course you need to use the link to your php script :rolleyes:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethen for the iPhone app side, the NSURLConnection should be placed at delegate file or the viewcontroller file?
thx a lot again...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome