Code: Select all
$objGrid -> FormatColumn("id", "ID", 10, 10, 0, "10", "center", "integer");
$objGrid -> FormatColumn("alumno_name", "Nombre", 30, 30, 0, "105", "left");
$objGrid -> FormatColumn("alumno_apellido", "Apellido", 30, 30, 0, "110", "left");
$objGrid -> FormatColumn("alumno_ano", "Ano", 3, 3, 0, "30", "center");
$objGrid -> FormatColumn("alumno_sec", "Secc", 5, 5, 0, "30", "left");
$objGrid -> FormatColumn("curso01", "curso01", 5, 5, 0, "30", "left");
Code: Select all
$con = mysql_connect("localhost", "db_test", "test");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("table_test",$con);
$sql = "SELECT * from authors";
$result = mysql_query($sql,$con);
$name1 = mysql_field_name($result, 2);
$objGrid -> FormatColumn("id", "ID", 10, 10, 0, "10", "center", "integer");
$objGrid -> FormatColumn("alumno_name", "Nombre", 30, 30, 0, "105", "left");
$objGrid -> FormatColumn("alumno_apellido", "Apellido", 30, 30, 0, "110", "left");
$objGrid -> FormatColumn("alumno_ano", "Ano", 3, 3, 0, "30", "center");
$objGrid -> FormatColumn("alumno_sec", "Secc", 5, 5, 0, "30", "left");
$objGrid -> FormatColumn("curso01", "curso01", 5, 5, 0, "30", "left");
[b]$objGrid -> FormatColumn("$name1", "$name1", 5, 5, 0, "30", "left");[/b]