This topic is locked

Unknown column 'fieldname' in 'field list'

1/8/2009 10:34:53 AM
PHPRunner General questions
I
imendes author

Hi, I'm having troubles editing my fields. I have just one table.

My select is:
SELECT

h_entidade AS Empresa,

h_hosting AS Hosting,

h_data_ini AS `Data Ini2`,

h_data_fim AS `Data Fim2`,

h_valor AS Valor,

h_custo AS Custo,

h_obs AS `Obs.`,

d_dominio AS `Dominio`,

d_entidade AS Entidade,

d_data_ini AS `Data Ini.`,

d_data_fim AS `Data Fim`,

d_valor AS Valor1,

d_custo AS Custo1,

d_periodo AS `Periodo`,

d_site AS Site,

d_man_ano AS `Man. Ano`,

d_div AS `Div.`,

d_obs AS `Obs.1`,

id AS Num,

chave

FROM dominios

ORDER BY h_valor DESC
In the error message (Unknown column 'fieldname' in 'field list'), the 'fieldname' is always the alias name. Then, I went to the source code in dominios_edit.php file and change all the lines:
$value=prepare_for_db("d_data_fim",$value,$type); and

$evalues["d_data_fim"]=$value;
than contains the alias name, and I changed to the field name, and everything works fine now. The problem is that when I want to change anything in phprunner, I override that changes, and the error is back again.
What is the problem?
Thank you.

A
alang 1/8/2009

It looks like you are editing the file generated by PHPR - this is not the "source" code. Everytime you build it will get overwritten by PHPR.
Don't use an alias in this way unless necessary (there are 1 or 2 situations where it is handy). If you want your field names to look nice for the user, edit them in the Label column on the "Choose fields" tab.