Quantcast
Viewing all articles
Browse latest Browse all 82110

Adding a non-database column in a server-side processing script

Hi

I'm using a PHP/mysqli setup that is working (I built it using the example on the site). I'm displaying 4 columns taken from 2 tables and everything is good.

Now, I need to add a button that once you click it, it sends data to a form where the information can be changed and saved back to the database. I know that my function works since it was working prior to implement server-side dataTables.

So my script ends like this:

	while ( $aRow = $rResult->fetch_assoc() ) {
	    $row = array();
	    for ( $i=0 ; $i<$iColumnCount ; $i++ ) {
	       if ( $aColumns[$i] != ' ' ) {
	            // General output
	            $row[] = $aRow[ $aColumns[$i] ];
	       }
	    }
		$row[] .= "test";
		//$row[] .= "<button icon='ui-icon-pencil2' onclick='resetEditBox({$sTable->id})'>Edit</button>";
	    $output['aaData'][] = $row;
	}
	echo json_encode( $output );

In the commented line is the button code that IS NOT getting parsed back to dataTables. IF I use a word (test in my example), everything is parsed correctly.

I have a feeling that I'm missing/forgetting something yet I can't pin point what it is.

I would gladly accept any hints/help that can get me back on track. Cheers!

Viewing all articles
Browse latest Browse all 82110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>