Hello
Is there an easy way to Suppress Column Names from what is returned by the MySQL Select Statement or in general within PHP? I am trying to do some simple math with PHP and the column name, from the mysql select statement always prefixes the value.
I know there is a command line option of mysql -N that will do it but I am not sure if I can use this within PHP.
thanks
Tony
Hi,
I am unable to understand your question completely. In PHP, we always get the fetched data as array and it’s up to us what to display from that array.
If you want to hide column names when displaying data in grid, you can use following css and place it with html code to hide columns:
<style>
.ui-jqgrid-htable { display: none; }
</style>
Hello Abu
When I perform simple calcs in the mysql select statement and assign them to a variable, the results from the query seem to include the value of the field and the column name from the MYSQL DB. Is there a way that I can exclude the column name from the MYSQL field and just return the field value only? Referring to the below, I want to retrieve only the calculated field only values from Sum(quantity * automation). Then I can create the equation $autop = $auto/$finaltotal but this is not working.
$auto = $g->execute_query(“SELECT Format(Sum(quantity * automation),0) as ” FROM tblestimate where projectnumberest = ‘$groupselectednew'”);
$autop = $g->execute_query(“SELECT Format((Sum(quantity * automation)/$finaltotal) * 100,1) as ” FROM tblestimate where projectnumberest = ‘$groupselectednew'”);
thanks
Tony
You can try following. see bold.
$auto = $g->execute_query(“SELECT Format(Sum(quantity * automation),0) as tmp FROM tblestimate where projectnumberest = ‘$groupselectednew’”);
$finaltotal = $auto[0][“tmp”];
$autop = $g->execute_query(“SELECT Format((Sum(quantity * automation)/$finaltotal) * 100,1) as ” FROM tblestimate where projectnumberest = ‘$groupselectednew’”);
If you send complete code, i can review further. This is with my limited understanding.