Bug #11974 Updated: Pb with odbc_columns(); the 12th result(description)has a incorrect format
| From: | php-bugs at lists dot php dot net | Date: | Thu, 25 Jul 2002 05:00:09 +0000 |
| Subject: | Bug #11974 Updated: Pb with odbc_columns(); the 12th result(description)has a incorrect format | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15119@lists.php.net to get a copy of this message | ||
ID: 11974
Updated by: php-bugs@lists.php.net
Reported By: moditii@yahoo.fr
-Status: Feedback
+Status: No Feedback
Bug Type: ODBC related
Operating System: Windows 98
PHP Version: 4.0.6
New Comment:
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2002-06-24 17:38:59] kalowsky@php.net
can you please give a sample schema to use as well?
Also you may wish to try a newer version of PHP as there have been some
changes in the codebase.
------------------------------------------------------------------------
[2001-07-09 08:00:08] moditii@yahoo.fr
The problem is that after these 2 lines:
$resCol=odbc_columns($odbc_connect);
$des=odbc_result($resCol,12);
the print function works(the same for echo), and show the description
as asked, but when I have to use it
in an SQLreq., I have an error:
####
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
error in string in query expression ''(ex: media).'.,
SQL state 37000 in SQLExecDirect in
C:\Inetpub\wwwroot\cgi-bin\database\configok.php on line 95
####
As you can see I use an Access Database(2000)
I tried to cut the string in logical way or static way but I don't find
one working
for all. However, often, if I cut the last 30 c. with $des=substr
($des, 0,strlen($des)-30);, it works for several fields, but not
all...I tried to cut 3, to keep all until "." that I had added to all
my fields.
So here is a part of my code:(it's to make a table containing all
fields with their description all fields have a different name) and I
can say that there is not any problem with para 3(name of table),4(name
of field):
$resCol=odbc_columns($odbc_connect);
$tablen=odbc_result($resTable,3);
while(odbc_fetch_row($resCol))
{
if (odbc_result($resCol,3)==$tablen)//if the table
of the column
{
//is the table called
$i++ ;
$col=odbc_result($resCol,4); //set col to the
name of the field
//############################description doesn't
work###################
$des=odbc_result($resCol,12);
//echo "<br>";
//print strlen($des);
// echo "<br>";
// $des=substr ($des, 0,strrpos ($des, ".")-1);
$des=substr ($des, 0,strlen($des)-30);
// print strlen($des);
echo "<br>";
if (empty($des))
{
$des="a definir";
}
echo "description: $des" ;
//#######################################################################
if (!empty($HTTP_POST_VARS['fillFields']))
{
$sql="INSERT INTO [FieldsUsed] (field,tablen,
descript) VALUES ('$col', '$tablen','$des')";
odbc_exec($odbc_connect,$sql);
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11974&edit=1