HI,
I need help in the following things:
We need to generate a report for the fields from the database. For example,
StudentId Firstname Lastname Class
101 abc def First year
102 efg hjk Third year
103 lmn rst First year
I need to wrtie a script using php that will change the text under the heading as below
StudentId Firstname Lastname Class
101 abc def Freshman
102 efg hjk Junior
103 lmn rst Freshman
This is how the output is needed.Replace each column with respective value.
So basicallly I need to change "First Year" to "Freshman" , "Third year" to "Junior" and we will have second year, foruth year also to change to sophomore and senior respectively.
I wrote this two lines to change the text with "Freshman" in all the places to just see how custom scripts works in the thrid party software.
$class = "Freshman";
$rows[0][3] ->val = $class; //this is the way I can call that column in this CRM software where I can define my scripts.
StudentId Firstname Lastname Class
101 abc def Freshman
102 efg hjk Freshman
103 lmn rst Freshman
But I could not figure out the id for the each different value under the column "Class" or how to change each different value under the column "Class".
It would be great if any one can help me in knowing the array structure in PHP..I can think of a way that I can write four if else conditions as I will have Four different values for the column " Class".
For example :
if ($rows[0][3] ->val = "First year"; //(I know I should call it through an id than calling it first year but I am not able represent it."
{
$rows[0][3] ->val = "Freshman"
else
{
....
....
....
}
}
Please help me out.
Thanks in advance
I need help in the following things:
We need to generate a report for the fields from the database. For example,
StudentId Firstname Lastname Class
101 abc def First year
102 efg hjk Third year
103 lmn rst First year
I need to wrtie a script using php that will change the text under the heading as below
StudentId Firstname Lastname Class
101 abc def Freshman
102 efg hjk Junior
103 lmn rst Freshman
This is how the output is needed.Replace each column with respective value.
So basicallly I need to change "First Year" to "Freshman" , "Third year" to "Junior" and we will have second year, foruth year also to change to sophomore and senior respectively.
I wrote this two lines to change the text with "Freshman" in all the places to just see how custom scripts works in the thrid party software.
$class = "Freshman";
$rows[0][3] ->val = $class; //this is the way I can call that column in this CRM software where I can define my scripts.
StudentId Firstname Lastname Class
101 abc def Freshman
102 efg hjk Freshman
103 lmn rst Freshman
But I could not figure out the id for the each different value under the column "Class" or how to change each different value under the column "Class".
It would be great if any one can help me in knowing the array structure in PHP..I can think of a way that I can write four if else conditions as I will have Four different values for the column " Class".
For example :
if ($rows[0][3] ->val = "First year"; //(I know I should call it through an id than calling it first year but I am not able represent it."
{
$rows[0][3] ->val = "Freshman"
else
{
....
....
....
}
}
Please help me out.
Thanks in advance
Comment