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 6337531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:16:10+00:00 2026-05-24T19:16:10+00:00

I have a small section of code. When the table is empty this code

  • 0

I have a small section of code. When the table is empty this code works fine and enters in to the table fine. But then if i try again then this fails with the error?

What am i doing wrong?

Thanks

// On my Function page

    function admin(){
                    connect();

                    $query = mysql_query("INSERT INTO results 
                    (t_id, pos1, pos2, pos3)
                    VALUES  ('$_POST[t_id]','$_POST[pos1]','$_POST[pos2]','$_POST[pos3]')")
                    or die ("Error.");

                    $b = "Updated fine</b></a>.";

                    return $b;
                        exit();
            }

    // Then on my main page

<?php
    include ('functions.php');
    if (isset($_POST['admin'])){
    $admin = admin();
    }
?>

            <div id="content">
                    <div id="admin">
                        <form action="" method="post">
                            <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
                                <tr>
                                    <td width="100%"><?php echo "$admin"; ?></td>
                                </tr>
                                <tr>
                                    <td width="100%"><label>Track <input type="text" name="track" size="25" value="<? echo $_POST[t_id]; ?>"></label></td>
                 </tr>
                                <tr>
                                    <td width="100%"><label>Position 1<input type="text" name="pos1" size="25" value="<? echo $_POST[pos1]; ?>"></label></td>
                                </tr>
                                <tr>
                                    <td width="100%"><label>Position 2 <input type="text" name="pos2" size="25" value="<? echo $_POST[pos2]; ?>"></label></td>
                                </tr>
                                <tr>
                                    <td width="100%"><label>Position 3 <input type="text" name="pos3" size="25" value="<? echo $_POST[pos3]; ?>"></label></td>
                                </tr>
                                <tr>
                                    <td width="100%"><input class="save" type="submit" value="" name="admin"></td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
  • 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-24T19:16:11+00:00Added an answer on May 24, 2026 at 7:16 pm

    Without seeing your table schema, I can only think you have UNIQUE t_id and you want to insert the same ID into it.

    Several way to debug:

    • Use or die ("Error: " . mysql_error()); instead of just or die ("Error.");
    • Check your table schema: SHOW CREATE TABLE tablename and write it down on your question, so we can see if it’s causing error.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a small problem i have xome xml with a cdata section. This
BACKGROUND: I would like to have small labels in columns of a table. I'm
Is this possible? I just want a small table in my current view... here
I'm using the term partial to refer to a small section of presentational code
I wrote this small bit of code to write to a plist file. I
I have a small database that requires multiple table queries to retrieve data. I
I wrote a small Shotgun app, however, the section of code that needs to
I have an in-memory table that might looks something like this: Favorite# Name Profession
Im not sure if i have explaned this the best i can but, here
So, I work in a fairly small IT section. We have a trouble ticketing

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.