how to insert data in previous register data in database queries?How does database indexing work?How do I quickly rename a MySQL database (change schema name)?How to list the tables in a SQLite database file that was opened with ATTACH?How to output MySQL query results in CSV format?How do I connect to a MySQL Database in Python?How to 'insert if not exists' in MySQL?How to get size of mysql database?What are the options for storing hierarchical data in a relational database?How to get the sizes of the tables of a MySQL database?PHP no error detected but not showing properly

How can I raise concerns with a new DM about XP splitting?

Can the electrostatic force be infinite in magnitude?

Can somebody explain Brexit in a few child-proof sentences?

Superhero words!

A workplace installs custom certificates on personal devices, can this be used to decrypt HTTPS traffic?

Can I rely on these GitHub repository files?

Organic chemistry Iodoform Reaction

Are Warlocks Arcane or Divine?

Teaching indefinite integrals that require special-casing

Partial sums of primes

What is the opposite of 'gravitas'?

Freedom of speech and where it applies

How do ultrasonic sensors differentiate between transmitted and received signals?

Lightning Web Component - do I need to track changes for every single input field in a form

How to check participants in at events?

Is exact Kanji stroke length important?

For airliners, what prevents wing strikes on landing in bad weather?

What if somebody invests in my application?

Simple recursive Sudoku solver

Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?

Lifted its hind leg on or lifted its hind leg towards?

Why isn't KTEX's runway designation 10/28 instead of 9/27?

What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?

Latex for-and in equation



how to insert data in previous register data in database queries?


How does database indexing work?How do I quickly rename a MySQL database (change schema name)?How to list the tables in a SQLite database file that was opened with ATTACH?How to output MySQL query results in CSV format?How do I connect to a MySQL Database in Python?How to 'insert if not exists' in MySQL?How to get size of mysql database?What are the options for storing hierarchical data in a relational database?How to get the sizes of the tables of a MySQL database?PHP no error detected but not showing properly













-1















I am developing an android application where I am registering an user by its username and after that again I want to register a candidate on same username. How to write php script(api) for this..Thanks in advanced



enter image description here



<?php
if($_SERVER['REQUEST_METHOD']=='POST')

include 'config.php';

$con = mysqli_connect($host,$user,$password,$db);

$S_name = $_POST['StudentName'];
$S_Phone = $_POST['StudentPhone'];
$S_Class = $_POST['StudentClass'];

$Sql_Query = "INSERT INTO registerDemo
(register_name,phone_number,class)
values ('$S_name','$S_Phone','$S_Class')";

if(mysqli_query($con,$Sql_Query))
echo 'Student Registered Successfully';
else
echo 'Something went wrong';


mysqli_close($con);
?>









share|improve this question
























  • Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

    – RiggsFolly
    Mar 7 at 10:28











  • Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

    – RiggsFolly
    Mar 7 at 10:29











  • Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

    – RiggsFolly
    Mar 7 at 10:30











  • How to write the php script so that I can insert (register_name,phone number and class) in registered username.

    – Prashant Das
    Mar 7 at 10:33












  • Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

    – RiggsFolly
    Mar 7 at 10:34















-1















I am developing an android application where I am registering an user by its username and after that again I want to register a candidate on same username. How to write php script(api) for this..Thanks in advanced



enter image description here



<?php
if($_SERVER['REQUEST_METHOD']=='POST')

include 'config.php';

$con = mysqli_connect($host,$user,$password,$db);

$S_name = $_POST['StudentName'];
$S_Phone = $_POST['StudentPhone'];
$S_Class = $_POST['StudentClass'];

$Sql_Query = "INSERT INTO registerDemo
(register_name,phone_number,class)
values ('$S_name','$S_Phone','$S_Class')";

if(mysqli_query($con,$Sql_Query))
echo 'Student Registered Successfully';
else
echo 'Something went wrong';


mysqli_close($con);
?>









share|improve this question
























  • Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

    – RiggsFolly
    Mar 7 at 10:28











  • Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

    – RiggsFolly
    Mar 7 at 10:29











  • Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

    – RiggsFolly
    Mar 7 at 10:30











  • How to write the php script so that I can insert (register_name,phone number and class) in registered username.

    – Prashant Das
    Mar 7 at 10:33












  • Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

    – RiggsFolly
    Mar 7 at 10:34













-1












-1








-1








I am developing an android application where I am registering an user by its username and after that again I want to register a candidate on same username. How to write php script(api) for this..Thanks in advanced



enter image description here



<?php
if($_SERVER['REQUEST_METHOD']=='POST')

include 'config.php';

$con = mysqli_connect($host,$user,$password,$db);

$S_name = $_POST['StudentName'];
$S_Phone = $_POST['StudentPhone'];
$S_Class = $_POST['StudentClass'];

$Sql_Query = "INSERT INTO registerDemo
(register_name,phone_number,class)
values ('$S_name','$S_Phone','$S_Class')";

if(mysqli_query($con,$Sql_Query))
echo 'Student Registered Successfully';
else
echo 'Something went wrong';


mysqli_close($con);
?>









share|improve this question
















I am developing an android application where I am registering an user by its username and after that again I want to register a candidate on same username. How to write php script(api) for this..Thanks in advanced



enter image description here



<?php
if($_SERVER['REQUEST_METHOD']=='POST')

include 'config.php';

$con = mysqli_connect($host,$user,$password,$db);

$S_name = $_POST['StudentName'];
$S_Phone = $_POST['StudentPhone'];
$S_Class = $_POST['StudentClass'];

$Sql_Query = "INSERT INTO registerDemo
(register_name,phone_number,class)
values ('$S_name','$S_Phone','$S_Class')";

if(mysqli_query($con,$Sql_Query))
echo 'Student Registered Successfully';
else
echo 'Something went wrong';


mysqli_close($con);
?>






mysql database phpmyadmin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 11:40









F8xLag

85




85










asked Mar 7 at 10:22









Prashant DasPrashant Das

327




327












  • Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

    – RiggsFolly
    Mar 7 at 10:28











  • Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

    – RiggsFolly
    Mar 7 at 10:29











  • Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

    – RiggsFolly
    Mar 7 at 10:30











  • How to write the php script so that I can insert (register_name,phone number and class) in registered username.

    – Prashant Das
    Mar 7 at 10:33












  • Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

    – RiggsFolly
    Mar 7 at 10:34

















  • Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

    – RiggsFolly
    Mar 7 at 10:28











  • Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

    – RiggsFolly
    Mar 7 at 10:29











  • Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

    – RiggsFolly
    Mar 7 at 10:30











  • How to write the php script so that I can insert (register_name,phone number and class) in registered username.

    – Prashant Das
    Mar 7 at 10:33












  • Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

    – RiggsFolly
    Mar 7 at 10:34
















Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

– RiggsFolly
Mar 7 at 10:28





Your script is wide open to SQL Injection Attack Even if you are escaping inputs, its not safe! Use prepared parameterized statements in either the MYSQLI_ or PDO API's

– RiggsFolly
Mar 7 at 10:28













Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

– RiggsFolly
Mar 7 at 10:29





Sorry, I dont understand what you are asking here. Can you edit your question so it is more obvious what you are asking for help with please

– RiggsFolly
Mar 7 at 10:29













Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

– RiggsFolly
Mar 7 at 10:30





Small Point You open the connection to the database INSIDE the IF but you close it OUTSIDE the IF? Move the close inside the IF

– RiggsFolly
Mar 7 at 10:30













How to write the php script so that I can insert (register_name,phone number and class) in registered username.

– Prashant Das
Mar 7 at 10:33






How to write the php script so that I can insert (register_name,phone number and class) in registered username.

– Prashant Das
Mar 7 at 10:33














Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

– RiggsFolly
Mar 7 at 10:34





Do you mean you have another table called registered that you want to place this data into? Or are you saying that the code you show us does not work

– RiggsFolly
Mar 7 at 10:34












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041388%2fhow-to-insert-data-in-previous-register-data-in-database-queries%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041388%2fhow-to-insert-data-in-previous-register-data-in-database-queries%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved