How to insert records to newly created table?

Hi I am creating a custom module which have some administration pages and there some fields in the UI. Also I have created a table to store those values.

I have tried to insert records to the table by following methods but nothing worked for me. I feel like the SuiteCRM does not allows to communicate to the custom tables.


     $db = $GLOBALS['db'];
     $query = "INSERT INTO taxi_accounts_fields (field_key) VALUES ('dddd')";
$result = $db->query($query);

Also I tried by creating a class


class ClientIDs extends Basic {

	var $new_schema = true;
	var $module_dir = 'ClientIDs';
	var $object_name = 'ClientIDs';
	var $table_name = 'client_ids';
	var $importable = true;
		var $id;
		var $name;
		var $date_entered;
		var $date_modified;
		var $modified_user_id;
		var $modified_by_name;
		var $created_by;
		var $created_by_name;
		var $description;
		var $deleted;
		var $created_by_link;
		var $modified_user_link;
		var $assigned_user_id;
		var $assigned_user_name;
		var $assigned_user_link;
		var $system_name;
			var $disable_row_level_security = true;
	
	function ClientIDs() {
		parent::Basic();
	}
	
	function bean_implements($interface){
		switch($interface){
			case 'ACL': return true;
		}
		return false;
	}
	
	
}
?>

$taxiAccount=new TaxiAccountFields();
$taxiAccount->id==2;
$taxiAccount->field_key=“dd”;
$taxiAccount->save();

But these two methods are not working.

Please help me on this

I am lost. What records are you trying to insert? I am unable to understand what is going on over here. Can you please elaborate?

I am creating a custom module for sutieCRM. the module has more than one table and store records in that table. I have tried to insert records through SuiteCRM controller(my module controller). But I am not able to insert records to the table.

This is the problem here

Why would you have two separate tables? What are you trying to achieve with two tables?
Your query does not seem wrong, turn on PHP display errors or check your log files to see whats causing the issue.

I am not creating two tables. I just tried to insert record for a table by two methods . But nothing working

The SQL query method runs OK but no records are in the table
when I dump the the $result variable it shows false;

Also the class methods prints some error, I have attached a screenshot of the error in the attachement

You seem to be creating a custom module from scratch using code .You are complicating things.
SuiteCRM offers module builder for this purpose, where you can use the GUI to make custom modules easily.
Navigate to Admin->Module Builder and create your own custom module from there.

Hi Arsalan

Yeah You are right , I am creating a custom module for some specific purpose. Can you help me on to inserting a record to the table or fixing that error? Possible?

Thank You for your kind help.