[snip]
I've got one for ya. I've been trying to conenct to a csv text file =
(comma delimited, \r\n row separators, and text qualifiers) using the =
odbc_connect command and then run simple select statements through it. =
It doesn't work and I'm at a loss for why.
[/snip]
Why not use fopen()?
text file connection problem
[snip]
I've got one for ya. I've been trying to conenct to a csv text file =
(comma delimited, \r\n row separators, and text qualifiers) using the =
odbc_connect command and then run simple select statements through it. =
It doesn't work and I'm at a loss for why
[snip]
As you can see, If I'm going to preserve the double quotes in the third
column, I would have to come up with a script that would deal with escaped
characters.
I was hoping that I could just establish an ODBC connection to the text
file, which it appears that I can, and then select stuff
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 12:03 PM
To: Ethan Nelson; [EMAIL PROTECTED]
Subject: RE: [PHP] ODBC text file connection problem
[snip]
As you can see, If I'm going to preserve the double quotes in the third column, I
would have
[snip]
// ODBC commands to explore connection:
$result = odbc_tables($odbc);
odbc_fetch_into($result,$row);
print_r($row);
[/snip]
Have you tried a WHILE loop to print out each row? I am not sure of the
exact syntax but something like;
?php
while(odbc_fetch_into($result, $fields)){
PROTECTED]
Subject: RE: [PHP] ODBC text file connection problem
[snip]
// ODBC commands to explore connection:
$result = odbc_tables($odbc);
odbc_fetch_into($result,$row);
print_r($row);
[/snip]
Have you tried a WHILE loop to print out each row? I am not sure of the exact syntax
but something like
[snip]
$odbc = odbc_connect(cvalcoinput,,) OR die(There is an error
connecting to the CSV file.);
$result = odbc_tables($odbc);
while(odbc_fetch_into($result, $fields)){
for ($i = 0; $i sizeof($fields); $i++) {
echo $fields[$i] . br;
}
}
Derives the following results:
7 matches
Mail list logo