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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:25:44+00:00 2026-06-08T07:25:44+00:00

This is the problematic part of code: $query = mysql_query(INSERT INTO members (user, pass,

  • 0

This is the problematic part of code:

$query = mysql_query("INSERT INTO members 
(user, pass, mail, country, city, www, credo)
VALUES  ('$_POST[user]','$_POST[pass]', '$_POST[mail]',
'$_POST[country]', '$_POST[city]', '$_POST[www]', '$_POST[credo]')")
or die ("Error - Couldn't register user.");

I got the die error.
How could I find more specific part which cannot be executed ?
I tried to eliminate fields one by one – without result.

  • 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-08T07:25:47+00:00Added an answer on June 8, 2026 at 7:25 am

    This should present you the reason behind your failed query, and at the very least prevent some security concerns:

    Small Improvement

    // Run by each $_POST entry and set it to empty if not found
    // Clean the value against tags and blank spaces at the edges
    $dataArr = array();
    foreach($_POST as $key => $value) {
        $dataArr[$key] = ($value == "undefined") ? '' : strip_tags(trim($value));
    }
    
    // try to perform the INSERT query or die with the returned mysql error
    $query = mysql_query("
      INSERT INTO members 
      (user, pass, mail, country, city, www, credo)
      VALUES (
        '".$dataArr["user"]."',
        '".$dataArr["pass"]."',
        '".$dataArr["mail"]."',
        '".$dataArr["country"]."',
        '".$dataArr["city"]."',
        '".$dataArr["www"]."',
        '".$dataArr["credo"]."'
      )
    ") or die ("Error:<br/>".mysql_error());
    

    Medium Improvement

    // Run by each $_POST entry and set it to empty if not found
    // Clean the value against tags and blank spaces at the edges
    $dataArr = array();
    foreach($_POST as $key => $value) {
        $dataArr[$key] = ($value == "undefined") ? '' : strip_tags(trim($value));
    }
    
    // escape everything
    $query = sprintf("
        INSERT INTO members 
        (user, pass, mail, country, city, www, credo) 
        value ('%s', '%s', '%s', '%s', '%s', '%s', '%s')",
        mysql_real_escape_string($dataArr["user"]), 
        mysql_real_escape_string($dataArr["pass"]), 
        mysql_real_escape_string($dataArr["mail"]), 
        mysql_real_escape_string($dataArr["country"]), 
        mysql_real_escape_string($dataArr["city"]), 
        mysql_real_escape_string($dataArr["www"]), 
        mysql_real_escape_string($dataArr["credo"])
    );
    
    // try to perform the INSERT query or die with the returned mysql error
    $result = mysql_query($query) or die ("Error:<br/>".mysql_error());
    

    Advanced Improvement

    If you’re starting a new project, or at a point where you can still change your ways, I vividly recommend the use of PHP PDO to prevent many security issues related the current database connection you’re using.

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

Sidebar

Related Questions

Situation: I often run into this problematic and never know how to solve it.
Here is the problematic part of my code, run inside .each(function(){ }); $('img','<div>'+ed.selection.getContent({format: 'html'})+'</div>').each(function(){
Here is the problematic part of my code: $('#chat-bar').prepend('<li id=chat-button-with-'+userid+'><a href=#>'+username+'</a></li>'); $('#chat').prepend('<div class=chat-box id=chat-box-with-'+userid+'></div>');
This has been a rather problematic issue on numerous occasions. We have alot of
This is my code: <CheckBox android:id=@+id/sprint_checkbox android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/sprint_game /> <CheckBox android:id=@+id/marathon_checkbox android:layout_width=fill_parent android:layout_height=wrap_content
This code below allows me to find the word error in all my files
Consider this code: public void actionPerformed(ActionEvent e) { setEnabled(false); new SwingWorker<File, Void>() { private
I'm posting this because, after battling with this problem for the better part of
While LOC (# lines of code) is a problematic measurement of a code's complexity,
I have this code here, which get a plain text, and turns it to

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.