Skip to content

Instantly share code, notes, and snippets.

@MahbbRah
Created April 26, 2016 15:59
Show Gist options
  • Save MahbbRah/79d3c478bf61f4511671f72ca7a654d1 to your computer and use it in GitHub Desktop.
Save MahbbRah/79d3c478bf61f4511671f72ca7a654d1 to your computer and use it in GitHub Desktop.
As you can see this is a working query. and now I want to add first and second field (int) value on 3rd field like $f_name + $m_name = value; with loop. how could i do that?
<?php
if(isset($_POST['Submit'])){
for($i=0;$i<$count;$i++){
$name = $_POST['name'];
$f_name = $_POST['lastname'];
$m_name = $_POST['email'];
// This is a query for uploading multiple values in single query.
$sql1="UPDATE computer SET s_name='$name[$i]', f_name='$f_name[$i]', m_name='$m_name[$i]' WHERE roll='$id[$i]'";
$result1=$db->dbc->query($sql1);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment