The class.dbFormhandler.php generates the INSERT statement, right?
Line 1639 - 1649 creates insert query ending with semicolon, how can I change that from my class?
1. Make sure you uncomment the php_syabase_ct.dll extension in php.ini
2. At the top of the class, I set this:
<?php
sybase_min_server_severity(20);
?>
Feel free to adjust the number (I'm no expert, I don't really know this thing except it removes warning)
3. For connection info, you have to refer your sql.ini usually located at C:\Sybase\ini
4. This is a sample create table
<?php
/**
* Sample CREATE TABLE
*
*
* CREATE TABLE climasdev.dbo.iyas_test5
* (file_no numeric IDENTITY,
* nama varchar(25) NULL,
* umur int NULL,
* kerja varchar(25) NULL,
* ic varchar(25) NOT NULL,
* PRIMARY KEY (file_no),
* UNIQUE (nama, ic))
*/
?>
Note that IDENTITY is - as I understand - as same as auto-increment field for mysql. It has to be numeric and cannot set as not null.
I'm still learning how Sybase handle composite unique key, because as for the above create statement, Sybase only accept 'nama' as UNIQUE key, not the combination of 'nama' and 'ic'.
This Sybase class doesn't have getInsertId(), getErrorNo() and escapeString().
Improvement are welcomed....
(Admin: Please tell me how to send you my Sybase class)
Not only I have to remove the last semi-colon. I also have to check that the last semi-colon must be in INSERT statement because if not, below example will get problem:
<?php
UPDATE 'tbl_test' SET 'field1' = 'some text with semi-colon;' WHERE id = 1
?>
I get this function to replace last semi-colon
(if you have better function, please let me know)
I'm about to send you the file, then I saw 'test' folder in 'yadal'. I test my class, got "Strict Standards: Declaration of SybaseASE::getFieldTypes() should be compatible with that of Yadal::getFieldTypes() in C:\xampp\htdocs\FH\yadal\class.SybaseASE.php on line 547"
Strangely, mysql layer (comes with FH bundle) also got the error.