[PHP] select result is not correct when using enum to do operations:
There are two problems in this issue:
1. The select result is not correct
2. The column names are not same as those in csql
{noformat}
Test verion:
Cubrid: CUBRID 9.0 (9.0.0.0455)
PHP Driver:
http://svn.cubrid.org/cubridapis/php/branches/RB-9.0.0 Revision: 867
{noformat}
The codes:
{noformat}
//select bind
print(*****************************************\n);
$sql = select e1 + ?, ? + e1, e1 + ?, e1 * ?, e1 + ? from t1 where e1 ? order by 1, 2, 3, 4, 5;
$a=1;
$b=1;
$c=1.1;
$d=5;
//$e=2;
$e='-';
$f=7;
$req = cubrid_prepare($conn, $sql, CUBRID_INCLUDE_OID);
cubrid_bind($req, 1, $a );
cubrid_bind($req, 2, $b );
cubrid_bind($req, 3, $c );
cubrid_bind($req, 4, $d );
cubrid_bind($req, 5, $e );
cubrid_bind($req, 6, $f );
cubrid_execute($req);
$column_names1 = cubrid_column_names($req);
$column_types1 = cubrid_column_types($req);
$size = count($column_names1);
for($i = 0; $i $size; $i++) {
printf(%-40s, $column_names1[$i]);
}
print(\n);
while($row = cubrid_fetch_row($req)){
for($i = 0; $i $size; $i++) {
printf(%-40s, $row[$i]);
}
print(\n);
}
{noformat}
Test result:
{noformat}
*****************************************
e1+ ?:0 ?:1 +e1 e1+ ?:2 e1* ?:3 e1+ ?:4
{noformat}
There are no values in result.
When using the sql in csql, the result:
{noformat}
csql select e1 + 1, 1 + e1, e1 + 1.1, e1 * 5, e1 + '-' from t1 where e1 7 order by 1, 2, 3, 4, 5;
=== Result of SELECT Command in Line 1 ===
2 2 2.100000000 5 'Sunday-'
2 2 2.100000000 5 'Sunday-'
3 3 3.100000000 10 'Monday-'
3 3 3.100000000 10 'Monday-'
4 4 4.100000000 15 'Tuesday-'
4 4 4.100000000 15 'Tuesday-'
5 5 5.100000000 20 'Wednesday-'
5 5 5.100000000 20 'Wednesday-'
6 6 6.100000000 25 'Thursday-'
6 6 6.100000000 25 'Thursday-'
7 7 7.100000000 30 'Friday-'
7 7 7.100000000 30 'Friday-'
12 rows selected.
Current transaction has been committed.
1 command(s) successfully processed.
{noformat}