如何在MySQL表单结果

时间:2017-07-31 18:00:51

标签: php mysql forms twitter-bootstrap

希望我能在这里解释比我的标题更好:(

基本上我从下面的站点获得了工作的mysql bootstrap表 https://sourcecodesite.com/use-bootstrap-tables-display-data-mysql.html

我已将其设置为显示并从我的数据库中获取我需要的结果,但是我想在销售表显示其结果之前设置一个英镑符号“£”(如下所示)

enter image description here

我试过编辑下面的代码,但没有成功,希望有人可以帮助我:)

{
    field: 'sales',
    title: £'Job Price',
    sortable: true,
}

生成代码如下

<?php 
	require 'db.php';
 		
 		$sqltran = mysqli_query($con, "SELECT * FROM results_tbl_1 WHERE ENG_ID='".$_SESSION['username']."'ORDER BY RECORD_ID DESC") or die(mysqli_error($con));
		$arrVal = array();
 		
		$i=1;
 		while ($rowList = mysqli_fetch_array($sqltran)) {
 								 
						$name = array(
								'num' => $i,
								'rec'=> $rowList['RECORD_ID'],
	 		 	 				'call'=> $rowList['CALL_ID'],
 	 		 	 				'eng'=> $rowList['ENG_ID'],
	 		 	 				'workcode'=> $rowList['Work_Code'],
	 		 	 				'sales'=> $rowList['Sales'],
	 		 	 				'paid'=> $rowList['How_Paid'],
	 		 	 				'invoice'=> $rowList['Invoice Number'],
	 		 	 				'date'=> $rowList['Date Completed']
	 		 	 				
	 		 
	 		 	 				
 	 		 	 			);		


							array_push($arrVal, $name);	
			$i++;			
	 	}
	 		 echo  json_encode($arrVal);		
 

	 	mysqli_close($con);
?> 

1 个答案:

答案 0 :(得分:0)

看看这是否有意义。我们将磅符号放入名为&#34; price的&#34;

的(假设的)字段中

&#13;
&#13;
$name = array(
    'num' => $i,
    'rec'=> $rowList['RECORD_ID'],
    'call'=> $rowList['CALL_ID'],
    'eng'=> $rowList['ENG_ID'],
    'workcode'=> $rowList['Work_Code'],
    
    'price' => '£' . $rowList['Price'], // MAYBE SOMETHING LIKE THIS
    
    'sales'=> $rowList['Sales'],
    'paid'=> $rowList['How_Paid'],
    'invoice'=> $rowList['Invoice Number'],
    'date'=> $rowList['Date Completed']
);

array_push($arrVal, $name); 
&#13;
&#13;
&#13;