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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:18:57+00:00 2026-05-30T21:18:57+00:00

This is the second time today debugging, that the mysql_query INSERT statement has given

  • 0

This is the second time today debugging, that the mysql_query INSERT statement has given me major problems.

$username = mysql_real_escape_string($_SESSION['username']);
$type = $_GET['type'];    
$title = $_GET['title'];
$activitytype = $_GET['activitytype'];
$desc = $_GET['desc'];
$thedate = $_GET['deadline'];
$amtppl = $_GET['amtpeople'];

So, all the variables are correct (as echoed by my own console), so it’s purely based on mysql INSERT statement again.

  mysql_query(" INSERT INTO activity 
(`username`, `title`, `details`, `datetime`, `people`, `activitytype`)
  VALUES ('$username', '$title', '$desc', '$thedate', '$amtppl', '$activitytype')");

Can anyone see what’s wrong with it here? The properties are all correct (Closely proof read each and every one).

Using mysql_error();
I get an error called:

Duplicate entry ‘0’ for key 1

Thanks a ton, Chris.

  • 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-30T21:18:58+00:00Added an answer on May 30, 2026 at 9:18 pm

    Seems you don’t have auto increment on your primary key. Please make it auto increment

    Other wise for unique index you should get last insert id or max id of that column and assign last insert id +1 form unique key column i.e make it unique.

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

Sidebar

Related Questions

I've a application that must work after another application. This second application has a
I've got a Perl script that needs to execute another Perl script. This second
I hope it's the heat, this is the second question today and it's one
It has become apparent through a series of SO questions today that I have
Ok, I need something like this: datediff(second, date_one, date_two) < 1 dates are stored
This is a second-hand question from an OS development site, but it made me
This is my second question on Bamboo ( My First One ). My understanding
This most be the second most simple rollover effect, still I don't find any
This bit of code is taking almost a half second to execute. Could somebody
I am using this date picker from jqueryui . If you look on that

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.