How To Create an App Like Instagram With a Web Service Backend - Part 1/2
How To Create an App Like Instagram With a Web Service Backend - Part 1/2
This is the official thread to discuss the following blog post: How To Create an App Like Instagram With a Web Service Backend - Part 1/2
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

rwenderlich - Site Admin
- Posts: 1776
- Joined: Thu Dec 23, 2010 4:14 pm
- Has thanked: 26 times
- Been thanked: 187 times
Re: How To Create an App Like Instagram With a Web Service B
Me and Databases are no friends
The last time I touched this stuff was as I followed Rays tutorial about redeeming promo codes.
The SQL command throws an error:
#1064 - 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 '"login" (
"IdUser" int(11) NOT NULL AUTO_INCREMENT,
"username" varchar(45)' at line 1
The last time I touched this stuff was as I followed Rays tutorial about redeeming promo codes.
The SQL command throws an error:
#1064 - 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 '"login" (
"IdUser" int(11) NOT NULL AUTO_INCREMENT,
"username" varchar(45)' at line 1
- zeiteisen
- Uber Haxx0r
- Posts: 70
- Joined: Mon May 02, 2011 8:41 pm
- Has thanked: 5 times
- Been thanked: 4 times
Re: How To Create an App Like Instagram With a Web Service B
I know the focus of this article isn't security, but anyone using the API php code should be aware. Setting a static salt in the app defeats the whole purpose of salting. Obtaining that one salt can result in the entire database being brute forced at once. The password should be hashed on the server with a unique salt per password and communication between the server and the app should be done over HTTPS (SSL). Also, I would recommend using prepared statements for SQL quries. Prepared statements make SQL injection not possible if done right. When you create SQL queries by joining strings, you are vulnerable to SQL injection.
- pinc
- n00b
- Posts: 2
- Joined: Fri Apr 15, 2011 4:37 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create an App Like Instagram With a Web Service B
@zeiteisen - not sure what's the problem with importing the SQL at your place, but here's a bit simplified version of the SQL script (for compatibility with older versions of MySQL, etc) give this version a try - maybe it'll go trough:
Let me know if that works out. Marin
- Code: Select all
CREATE TABLE `login` (
`IdUser` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(45) NOT NULL,
`pass` varchar(45) NOT NULL,
PRIMARY KEY (`IdUser`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `photos` (
`IdPhoto` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
`IdUser` int(11) NOT NULL,
PRIMARY KEY (`IdPhoto`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Let me know if that works out. Marin
-

icanzilb - iOS Tutorial Team Member
- Posts: 236
- Joined: Tue Jan 11, 2011 10:33 am
- Has thanked: 10 times
- Been thanked: 16 times
Re: How To Create an App Like Instagram With a Web Service B
icanzilb,
I was getting the same error and your SQL script worked. Thanks!
zeiteisen,
I'm using XAMPP from the link in the tutorial. Bring up the phpMyAdmin in XAMPP, create the database, 'iReport'. Click the SQL tab, copy and paste the script from icanzib, click go. It should work for you.
JC
I was getting the same error and your SQL script worked. Thanks!
zeiteisen,
I'm using XAMPP from the link in the tutorial. Bring up the phpMyAdmin in XAMPP, create the database, 'iReport'. Click the SQL tab, copy and paste the script from icanzib, click go. It should work for you.
JC
- jlchapman
- Hacker
- Posts: 14
- Joined: Thu Nov 10, 2011 11:50 pm
- Has thanked: 1 time
- Been thanked: 0 time
Re: How To Create an App Like Instagram With a Web Service B
Thanks you. The new sql commands are working.
- zeiteisen
- Uber Haxx0r
- Posts: 70
- Joined: Mon May 02, 2011 8:41 pm
- Has thanked: 5 times
- Been thanked: 4 times
Re: How To Create an App Like Instagram With a Web Service B
awesome guys, I'm glad you can go on with the tutorial!
-

icanzilb - iOS Tutorial Team Member
- Posts: 236
- Joined: Tue Jan 11, 2011 10:33 am
- Has thanked: 10 times
- Been thanked: 16 times
Re: How To Create an App Like Instagram With a Web Service B
[s]umm if using XAMPP on mac, how do i do the SQL statements? lol[/s]
Nevermind... didn't know you could do it thru the XAMPP page using phpMyAdmin
Nevermind... didn't know you could do it thru the XAMPP page using phpMyAdmin
Last edited by shippo0708 on Fri Jul 13, 2012 12:03 am, edited 1 time in total.
-

shippo0708 - Uber Haxx0r
- Posts: 458
- Joined: Fri Apr 15, 2011 4:06 am
- Has thanked: 2 times
- Been thanked: 26 times
Re: How To Create an App Like Instagram With a Web Service B
When I try to Register with the app I get the following Error:
"Expected status code in (200-299), got 404"
can anyone tell me what I might have done wrong?
"Expected status code in (200-299), got 404"
can anyone tell me what I might have done wrong?
Re: How To Create an App Like Instagram With a Web Service B
William wrote:When I try to Register with the app I get the following Error:
"Expected status code in (200-299), got 404"
can anyone tell me what I might have done wrong?
Do you have your app pointing to the right "server" 404 usually means page not found
(could be wrong though)
-

shippo0708 - Uber Haxx0r
- Posts: 458
- Joined: Fri Apr 15, 2011 4:06 am
- Has thanked: 2 times
- Been thanked: 26 times
Who is online
Users browsing this forum: No registered users and 8 guests