FooKelvin Posted October 25, 2016 Share Posted October 25, 2016 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 Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/ Share on other sites More sharing options...
requinix Posted October 25, 2016 Share Posted October 25, 2016 What's your code? Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538588 Share on other sites More sharing options...
FooKelvin Posted October 25, 2016 Author Share Posted October 25, 2016 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. Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538605 Share on other sites More sharing options...
requinix Posted October 25, 2016 Share Posted October 25, 2016 For clarification, exactly what does the text wont display ourmean? Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538610 Share on other sites More sharing options...
Barand Posted October 25, 2016 Share Posted October 25, 2016 Your code has quotes missing. Notice the color of the text in the code box above? Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538616 Share on other sites More sharing options...
FooKelvin Posted October 26, 2016 Author Share Posted October 26, 2016 (edited) 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 October 26, 2016 by FooKelvin Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538623 Share on other sites More sharing options...
FooKelvin Posted October 26, 2016 Author Share Posted October 26, 2016 Is like when the Description column data type = Short Text.. my output display perfectly.. When i change the data type to = Long Text.. my output show empty.. Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538624 Share on other sites More sharing options...
Jacques1 Posted October 26, 2016 Share Posted October 26, 2016 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? Quote Link to comment https://forums.phpfreaks.com/topic/302400-microsoft-access-database/#findComment-1538625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.