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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:14:56+00:00 2026-06-04T01:14:56+00:00

I have got this function: public static function insert_user($user) { $con = mysql_connect(localhost,root,) or

  • 0

I have got this function:

   public static function insert_user($user)
{
    $con = mysql_connect("localhost","root","") or die(mysql_error());
    mysql_select_db("speakom",$con) or die(mysql_error());
    mysql_query("INSERT INTO user (user_ip,user_name,full_name,email_address,password,gender,birthday,banned,role,country) 
        VALUES('".$user->ip."','".$user->name."','".$user->full_name."','".$user->email."','".$user->password."',".$user->gender.",'".$user->birthday."',".$user->banned.",".$user->role.",'".$user->country."'") or die(mysql_error());
    mysql_close($con);
}

And I get this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 2

Where does the error point to ? how do I know where the error is?

  • 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-04T01:14:58+00:00Added an answer on June 4, 2026 at 1:14 am

    You’re missing the closing ) from the VALUES ( clause. In general, it’s easier to assign your SQL to a variable (which you can output for debugging purposes like this) prior to passing it to mysql_query.

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

Sidebar

Related Questions

I've got this function public static AdoEntity.Inspector GetInspectorWithInclude(int id, List<string> properties) { using (var
I have got this function : function getTitle(){ $crawler = new DOM_Crawler($this->url); try{ if
I have got code like this var challegneListener; $(document).ready(function(){ var challegneListener = setInterval(challengeListenerBot(),5000); });
Code is not running on .click when I have this: $(.cancel).click(function() { alert(got here);
I've got a recursive function with the signature public static string Recurse(string pattern, ObjectDict
I have got this link: <a href=http://iml.com/wmaster.ashx?WID=124904080515&amp;cbname=liveealve&amp;LinkID=701&amp;queryid=138&amp;from=freevideo6&amp;promocode=BETLNK&amp;FRefID=-1&amp;FRefP=none&amp;FRefQS=none rel=nofollow title=Visit imLive.com target=_blank class=sitelink_external imlive>Visit imLive.com</a>
I have got this link echoed in php: echo <a href='$appUrl' class='link-wrapper'></a>; $appUrl gives
I have got this regexp ^[0-9]+\.?[0-9]*$) to match a double number or an integer
I have got this button which uses onclicklistener and onlongclicklistener, but also a button
I have got this code and I need to access somehow Button and call

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.