Selection line of a PHP / HTML table
Selection line of a PHP / HTML table
Hello,
So I fill in an HTML table using PHP, I would like the power to select an entire row, ie retrieve a row from the array for inserted in the entry corresponding to the column name. Possible? If so in PHP? In JavaScript? Other?
J 'started in php here is the code that I realized but the worry is that I take a cell judged so I am all in line distributed on several entry
code php & html:
<?php require_once "PDO_connect.php";
$query="SELECT * FROM smartphone.abonnements";
try{
$prep = $bdd->prepare($query);
$prep->execute();
$resultats = $prep->fetchAll();
}catch(Exception $e){;
echo "Erreur ! ".$e->getMessage() ;
}
$host = "localhost";
$user = "root";
$pass = "Mm101010";
$dbn = "smartphone";
$link = mysqli_connect($host, $user, $pass, $dbn);
Abonnements
Operateur | SIM | PUK | Num ligne | Volume | Statut abo |
---|---|---|---|---|---|
".$row["Operateur"]." | "; echo "".$row["Num_SIM"]." | "; echo "".$row["PUK"]." | "; echo "".$row["Num_ligne"]." | "; echo "".$row["Volume"]." | "; echo "".$row["Statut_abo"]." | "; echo "
'; } ?>
Operateur : |
code js:
function getTrValues(e){
var el=e.target.parentNode
if(el.cells && el.parentNode.rows[0]!=el){
var all=document.getElementById('saisie').getElementsByTagName("input")
var cells = el.cells
var cellcount = cells.length;
for( c=0; c<cellcount; c++) {
all[c].value=cells[c].innerHTML
}
}
}
thank
Answers
Please format the code into a readable way so others may assist you, thanks
Code php et html:
`<?php require_once "PDO_connect.php";
$query="SELECT * FROM smartphone.abonnements";
try{
$prep = $bdd->prepare($query);
$prep->execute();
$resultats = $prep->fetchAll();
}catch(Exception $e){;
<?php > <!DOCTYPE> Abonnement .selline { background-color: silver;}echo "Erreur ! ".$e->getMessage() ;
}
$host = "localhost";
$user = "root";
$pass = "Mm101010";
$dbn = "smartphone";
$link = mysqli_connect($host, $user, $pass, $dbn);
Abonnements
'; } ?>
Please format your code using Markdown.
https://datatables.net/manual/tech-notes/8
Also your original question is very difficult to understand. Can you explain it better?