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

  • Home
  • SEARCH
  • 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 8024035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:44:39+00:00 2026-06-04T22:44:39+00:00

I have a SQL DB that is just one table with one row that

  • 0

I have a SQL DB that is just one table with one row that I would like to increment from my iphone, just to test out communication with a server.

I have done this with the phone before but I have never done the stuff on there server side and would like to learn.

so far I have created the sql db as said above. it is pretty much just this.

CREATE TABLE workers
(
id SMALLINT NOT NULL AUTO_INCREMENT
)

that could be slightly wrong.. it took me a couple of times to get it to work on the server and I am only writing it from memory now.

However now I would like to figure out how to just make it increment from a php script on my server… so far for the script I have done the basic stuff you do to get it to check for the DB connectivity so it looks a little something like this..

<?PHP
$con = mysql_connect("db.url.com","pass","username");
if (!$con){die('Could not connect: ' . mysql_error());}
mysql_select_db("db", $con);

?>

I am not sure what to do now.. I would guess its some type of insert statment, but im not sure of this as I am using Auto Increment on that row…

any help would be greatly appreciated.. hopefully once I have had help figuring this out I will be able to move on and do more complex things myself 🙂

  • 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-06-04T22:44:40+00:00Added an answer on June 4, 2026 at 10:44 pm

    The mysql connection:

    <?php 
    $hostname = "yourhostname";
    $database = "yourdatabase";
    $username = "youusername";
    $password = "yourpasword@";
    $conn = mysql_pconnect($hostname,$username,$password) or die();
    mysql_select_db($database,$conn) or die(“ERROR ”.mysql_error());
    ?>
    

    Then the INSERT:

    <?php
    mysql_query("INSERT INTO workers (id) VALUES (null)");
    ?>
    

    Hope it helps! =D

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

Sidebar

Related Questions

I have an SQL statement that looks something like: SELECT * FROM table1 AS
I have a sql statement that brings back the following rows: I would like
I have written a SQL query that works just fine, but am having a
I have a SqlDump.sql file that works just fine when I apply it using
I have an sql statement that currently is just returning all the end parent
I have SQL table that holds buyers personal data such as FirstName, LastName, OGCard;
I have a sql database that querys the histroy data of engines. One of
I have a SQL database that queries the history data of engines. One of
Assuming I have a table like this one: CREATE TABLE user_delegates ( [id] INT
I have a table that is setup like so: ID int Hash varchar OtherID

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.