Problem with ComboBox on Form populated via DB

I have an issue with the combobox on the form.

That data is loaded correctly from the DB.

<?php 
require_once("../codebase/connector/combo_connector.php");
$res=mysql_connect("localhost","***********","********");
mysql_select_db("DMN_DR");

$sql = "SELECT DISTINCT(PAYE) PAYE, PAYE from tblEmployees";
 
$data = new ComboConnector($res, "MySQL");
$data->render_sql($sql,"ID","PAYE, PAYE");
?>

But when the data is inserted into the DB instead of the string in inserts a number like: 1365170168x0

If I type data into the combobox it inserts the data correctly.
Does this mean that it will only look at ID,VALUE combinations and cannot use existing data ?

into the DB instead of the string in inserts a number like: 1365170168x0

It means - you are using not existing field as ID parameter of render_ command.
As result connector will generate random ids, which is fine for data loading but will not work for data saving.

Double check that all fields in your query is valid and named exactly the same in database.

Is there a way to save the Value NOT the ID ?

The problem was with the SQL. Had a moment :unamused:

I only needed DISTINCT(PAYE) once in the SQL but use it twice when I render the SQL.

<?php 
require_once("../codebase/connector/combo_connector.php");
$res=mysql_connect("localhost","*****","******");
mysql_select_db("DMN_DR");

$sql = "SELECT PAYE from tblEmployees group by PAYE";
 
$data = new ComboConnector($res, "MySQL");
$data->render_sql($sql,"PAYE","PAYE, PAYE");
?>