Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6239647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:25:35+00:00 2026-05-24T11:25:35+00:00

I am new to PHP and mysql and i am trying to make API’s

  • 0

I am new to PHP and mysql and i am trying to make API’s for my iphone app.
So far i have been able to connect and retrive data from my sql database now m trying to make entries to it using API’s and parameters.

Can anyone help me out here please.

Thanks alot!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:25:36+00:00Added an answer on May 24, 2026 at 11:25 am

    If by to make entries you mean adding data to the database.

    You do this in the same way that you select data.
    Instead of issuing a select statement like:

    SELECT x,y,z FROM table1 
    

    You do:

    INSERT INTO table1 (x,y,z) VALUES ('a', 1, 'test')
    

    Or:

    UPDATE table1 SET x = 'b' WHERE x = 'a'
    

    How you pass parameters depends on the API you use.
    It is best (safest) to use PDO to pass parameters.

    How to get parameters out of a url
    In order to get the parameters out of the url (e.g.: example.com/test.php?username=xyz&password=!@#$%) do:

    $username = mysql_real_escape_string($_GET['username']);  
    $password = mysql_real_escape_string($_GET['password']);  
    $query = "SELECT * FROM users WHERE username = '$username' 
              AND passhash = sha2(CONCAT(salt,'$password'),512)";
    

    Note that it’s vital to put single quotes around the injected variable names when using mysql_real_escape_string() or the escaping will be useless. Used like this the code is 100% secure from SQL-injection.

    If you’re using PDO, you can drop the mysql_real_escape_string() if not you need it to prevent SQL-injection.

    Links
    http://dev.mysql.com/doc/refman/5.5/en/update.html
    http://dev.mysql.com/doc/refman/5.5/en/insert.html
    http://php.net/manual/en/ref.pdo-mysql.php
    https://stackoverflow.com/search?q=%5Bphp%5D+%5Bmysql%5D+pdo
    http://php.net/manual/en/reserved.variables.get.php
    http://php.net/manual/en/function.mysql-real-escape-string.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use a PHP form (new.php) to update 2 MySQL tables
I am writing a new website that uses PHP and MySQL. I am trying
New to PHP and MySQL, have heard amazing things about this website from Leo
I am fairly new to php and mysql but I have created a small
I am pretty new to both php and mysql. I have a txt file
I am wondering I have been trying to place me MySQL query and MySQL
I'm trying to make a small cms in php and mysql, and want it
I have been trying to figure out a way to make this work, but
I'm trying to make a dynamic table with PHP. I have a page which
I have been trying to follow this tutorial: http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ . It is to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.