I have a problem with :
Apache_1.3.12
php-4.0.1pl2
unixODBC-1.8.12
MySQL 3.23.14-1
MyODBC 2.50.32-1
Here is my script :
<HEAD>
<TITLE>Essai ODBC</TITLE>
</HEAD>
<BODY>
<?
print("Test ODBC<BR>");
$connect = odbc_connect("MySQL", "root", "petrini");
$query = "select * from Dealer";
$result = odbc_do($connect, $query);
while(odbc_fetch_row($result))
{
$nom = odbc_result($result, 1);
$prenom = odbc_result($result, 2);
$datenaiss = odbc_result($result, 3);
print("$nom $prenom $datenaiss<BR>/n");
}
odbc_close($connect);
?>
</BODY>
Ok for the odbc_connect, but the odbc_do fail whith the following error in Netscape :
"The document contain no data, try again later ......"
Here is the GDB trace :
[root@claudepe bin]# gdb /www/bin/httpd
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) r -X
Starting program: /www/bin/httpd -X
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x40245962 in my_SQLPrepare (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at prepare.c:167
167 prepare.c: No such file or directory.
(gdb) bt
#0 0x40245962 in my_SQLPrepare (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at prepare.c:167
#1 0x402434d1 in SQLExecDirect (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at execute.c:445
#2 0x4002ebd9 in SQLExecDirect (statement_handle=136353416,
statement_text=0x81cb304 "select * from Dealer", text_length=-3)
at SQLExecDirect.c:291
#3 0x8098e89 in php_if_odbc_exec ()
#4 0x810ac3c in execute ()
#5 0x807e85b in php_execute_script ()
#6 0x80f0760 in apache_php_module_main ()
#7 0x807c63b in send_php ()
#8 0x807c67c in send_parsed_php ()
#9 0x8114333 in ap_invoke_handler ()
#10 0x8127869 in ap_some_auth_required ()
#11 0x81278cc in ap_process_request ()
#12 0x811f16e in ap_child_terminate ()
#13 0x811f2fc in ap_child_terminate ()
#14 0x811f459 in ap_child_terminate ()
#15 0x811fa86 in ap_child_terminate ()
#16 0x8120213 in main ()
#17 0x401201eb in __libc_start_main (main=0x811fecc <main>, argc=2,
---Type <return> to continue, or q <return> to quit---
argv=0xbffffbe4, init=0x806317c <_init>, fini=0x814d7ac <_fini>,
rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffbdc)
at ../sysdeps/generic/libc-start.c:90
(gdb) quit
The program is running. Exit anyway? (y or n) y
[root@claudepe bin]#
Apache_1.3.12
php-4.0.1pl2
unixODBC-1.8.12
MySQL 3.23.14-1
MyODBC 2.50.32-1
Here is my script :
<HEAD>
<TITLE>Essai ODBC</TITLE>
</HEAD>
<BODY>
<?
print("Test ODBC<BR>");
$connect = odbc_connect("MySQL", "root", "petrini");
$query = "select * from Dealer";
$result = odbc_do($connect, $query);
while(odbc_fetch_row($result))
{
$nom = odbc_result($result, 1);
$prenom = odbc_result($result, 2);
$datenaiss = odbc_result($result, 3);
print("$nom $prenom $datenaiss<BR>/n");
}
odbc_close($connect);
?>
</BODY>
Ok for the odbc_connect, but the odbc_do fail whith the following error in Netscape :
"The document contain no data, try again later ......"
Here is the GDB trace :
[root@claudepe bin]# gdb /www/bin/httpd
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) r -X
Starting program: /www/bin/httpd -X
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x40245962 in my_SQLPrepare (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at prepare.c:167
167 prepare.c: No such file or directory.
(gdb) bt
#0 0x40245962 in my_SQLPrepare (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at prepare.c:167
#1 0x402434d1 in SQLExecDirect (hstmt=136354616,
szSqlStr=0x81cb304 "select * from Dealer", cbSqlStr=-3) at execute.c:445
#2 0x4002ebd9 in SQLExecDirect (statement_handle=136353416,
statement_text=0x81cb304 "select * from Dealer", text_length=-3)
at SQLExecDirect.c:291
#3 0x8098e89 in php_if_odbc_exec ()
#4 0x810ac3c in execute ()
#5 0x807e85b in php_execute_script ()
#6 0x80f0760 in apache_php_module_main ()
#7 0x807c63b in send_php ()
#8 0x807c67c in send_parsed_php ()
#9 0x8114333 in ap_invoke_handler ()
#10 0x8127869 in ap_some_auth_required ()
#11 0x81278cc in ap_process_request ()
#12 0x811f16e in ap_child_terminate ()
#13 0x811f2fc in ap_child_terminate ()
#14 0x811f459 in ap_child_terminate ()
#15 0x811fa86 in ap_child_terminate ()
#16 0x8120213 in main ()
#17 0x401201eb in __libc_start_main (main=0x811fecc <main>, argc=2,
---Type <return> to continue, or q <return> to quit---
argv=0xbffffbe4, init=0x806317c <_init>, fini=0x814d7ac <_fini>,
rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffbdc)
at ../sysdeps/generic/libc-start.c:90
(gdb) quit
The program is running. Exit anyway? (y or n) y
[root@claudepe bin]#