Jump to content
FooKelvin

Microsoft Access Database

Recommended Posts

Hi All, I facing a problem with Ms Access. When i set my datatype to "Short Text", the data display perfectly. just because of limitation of "Short Text", it can only handle 255. So i decided to change the datatype to "Long Text", but the text wont display our. 

 

FYI, im using for web base data and i am using PHP language.

 

Thanks

Share this post


Link to post
Share on other sites

What's your code?

$sql = "SELECT * FROM 
    (requestorInfo i 
    LEFT JOIN requestStatus s ON i.RequestID = s.RequestID)
    INNER JOIN requestRoomInfo ri ON ri.RequestID = i.RequestID";
$rs = odbc_exec($conn, $sql);

PHP CODE

echo "<tbody>";
while (odbc_fetch_row($rs)) {
                $desc = odbc_result($rs, "Description");

                $tbody = '<tr><td>'.$desc.'</td>
                echo $tbody . '';
                echo '</tr>';
}
echo '</table>';


The $desc display out when the data type in Ms Acess is Short Text. Once i change to Long Text, it display empty.

Share this post


Link to post
Share on other sites

For clarification, exactly what does

the text wont display our

mean?

Share this post


Link to post
Share on other sites

Your code has quotes missing. Notice the color of the text in the code box above?

Share this post


Link to post
Share on other sites

Your code has quotes missing. Notice the color of the text in the code box above?

echo '<tbody>';
while (odbc_fetch_row($rs)) {
     $desc = odbc_result($rs, "Description");
     $tbody = '<tr><td>'.$desc.'</td>
     echo $tbody . ';
     echo '</tr>';
}
echo '</table>';
Edited by FooKelvin

Share this post


Link to post
Share on other sites

Is like when the Description column data type = Short Text..

my output display perfectly..

post-179514-0-05490800-1477442403_thumb.png

 

When i change the data type to = Long Text..

my output show empty..

post-179514-0-49733300-1477442455_thumb.png

 

Share this post


Link to post
Share on other sites

Look at the output. It's not just empty text, the entire rows are missing. This means your script probably fails at some point, but you've not managed to set up proper error handling.

 

Turn your error reporting all the way up and either display the errors (during development) or log them (in production). Unless the ODBC throws exceptions automatically, you also need to do this manually. Don't just assume that every function call succeeds.

 

It also helps to run the query alone (in the console or in phpmyadmin). Does it yield the correct result set?

 

Finally, I'm irritated that each fragment of your alleged code contains syntax problems, even though you claimed it worked fine before the data type change. So did you change the code as well?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.