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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:06:22+00:00 2026-05-22T16:06:22+00:00

$queryStatus = mysql_query(INSERT into `database`.`users` (`first`, `last`, `pass`, `user`, `id`, `email`, `active`) VALUES (‘$first’,

  • 0
$queryStatus = mysql_query("INSERT into `database`.`users` (`first`, `last`, `pass`, `user`, `id`, `email`, `active`) VALUES ('$first', '$last', '$password', '$user', NULL, '$email', '0'") or die("BAD QUERY: " . mysql_error());

The ID field is NULL because it is an auto-increment. But it is throwing a syntax error and I really can’t find out why. Please help.

  • 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-22T16:06:22+00:00Added an answer on May 22, 2026 at 4:06 pm

    Ignore the ID field, it will insert the value automatically:

    $queryStatus = mysql_query("INSERT into `database`.`users` (`first`, `last`, `pass`, `user`, `email`, `active`) VALUES ('$first', '$last', '$password', '$user', '$email', '0'") or die("BAD QUERY: " . mysql_error());
    

    Also your query seems badly formed (incorrectly places quotation mark at end), I’m not sure about PHP specifically but this should work:

    $queryStatus = mysql_query("INSERT into `database`.`users` (`first`, `last`, `pass`, `user`, `email`, `active`) VALUES ('$first', '$last', '$password', '$user', '$email', '0')");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suposse I have the next MySQL database with 500.000 rows : users { id
We are required to give a user permissions to Start, Stop, and Query status
Here is the XML How using E4X read values of nodes <status>௵௸</status> and of
I wonder if anyone can tell me why does QueryStatus() method get called so
Am working on web based Job search application using Lucene.User on my site can
I have implemented below function in a separate .js script file which I load
I am facing a really weird problem. I am using swfupload to upload multiple
I have an issue that is occurring after my server reboots. I have some
In the documentation of sqlalchemy I read: class sqlalchemy.types.Boolean(create_constraint=True, name=None) A bool datatype. Boolean
I want to implement an Observer of a Model class which does not change

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.