Get row details from a column which is not shown?
Get row details from a column which is not shown?
Rawland_Hustle
Posts: 94Questions: 16Answers: 0
Hi!
My knowledge of coding is basically zero, but I've somehow managed to use the "hidden row details example" and after several hours of trail and error I've almost got it to work :) I've got a MySQL database from which I'm getting data to display in DataTables. To do that, I'm using this code I found (below).
What I'd like to get help with is to have "hidden row details" show information from my database which is NOT shown in the table. When I click the plus sign, I want DataTables to get data from, let's say, column 7. But I don't want column 7 to be visible in the table. I just want the first 3 columns to be shown (like below).
Thanks! :)
[code]
<?php
$dbhost = 'hidden';
$dbuser = 'hidden';
$dbpass = 'hidden';
$dbname = 'hidden';
// Create connection
$con=mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
$result = mysqli_query($con,"SELECT * FROM world");
echo "
Column1
Column2
Column3
";
while($row = mysqli_fetch_array($result))
{
echo "";
echo "" . $row['country'] . "";
echo "" . $row['city'] . "";
echo "" . $row['population'] . "";
echo "";
}
echo "";
mysqli_close($con);
?>
[/code]
My knowledge of coding is basically zero, but I've somehow managed to use the "hidden row details example" and after several hours of trail and error I've almost got it to work :) I've got a MySQL database from which I'm getting data to display in DataTables. To do that, I'm using this code I found (below).
What I'd like to get help with is to have "hidden row details" show information from my database which is NOT shown in the table. When I click the plus sign, I want DataTables to get data from, let's say, column 7. But I don't want column 7 to be visible in the table. I just want the first 3 columns to be shown (like below).
Thanks! :)
[code]
<?php
$dbhost = 'hidden';
$dbuser = 'hidden';
$dbpass = 'hidden';
$dbname = 'hidden';
// Create connection
$con=mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
$result = mysqli_query($con,"SELECT * FROM world");
echo "
Column1
Column2
Column3
";
while($row = mysqli_fetch_array($result))
{
echo "";
echo "" . $row['country'] . "";
echo "" . $row['city'] . "";
echo "" . $row['population'] . "";
echo "";
}
echo "";
mysqli_close($con);
?>
[/code]
This discussion has been closed.
Replies
Then use fnGetData to get the data array for the whole row.
Allan
Your help is appreciated!