itetcboo Posted March 10, 2009 Share Posted March 10, 2009 Hi all! I have a mdb db, which I can access through odbc via php, but I can only make sql sentences like select * from mytable. If I add a WHERE clause or something else, I get a blank page. I have created a simple index.php with this code: <?php if ($conn_access = odbc_connect ( "gestoria", "", "",SQL_CUR_USE_ODBC)) { echo "Conectado correctamente" . "<BR>"; $ssql = "select * from expedientes where numero_expediente=1"; echo "<BR>" . $ssql . "<BR>"; if($rs_access = odbc_exec ($conn_access, $ssql)){ echo odbc_num_rows($rs_access); echo "sql sentence succesfull"; while ($fila = odbc_fetch_object($rs_access)){ $fila = odbc_fetch_object($rs_access); echo "<br>" . $fila->numero_expediente; } }else{ echo "error trying to execute SQL"; } } else{ echo "Error conexion with db"; } ?> any help please? 10x in advance Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/ Share on other sites More sharing options...
itetcboo Posted March 17, 2009 Author Share Posted March 17, 2009 No1 can help me a little bit? Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-786651 Share on other sites More sharing options...
itetcboo Posted May 4, 2009 Author Share Posted May 4, 2009 225 views and no one comment? Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-825752 Share on other sites More sharing options...
Axeia Posted May 5, 2009 Share Posted May 5, 2009 Did you try to manually echo out the query and execute it trough other means? Adding a if (odbc_error()) { echo odbc_errormsg($conn); } might proof useful as well. Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-826623 Share on other sites More sharing options...
itetcboo Posted May 7, 2009 Author Share Posted May 7, 2009 Thanks for your answer, I have put the code like this (entire code): <?php if ($conn_access = odbc_connect ( "gestoria", "", "")) { echo "Conectado correctamente" . "<BR>"; $ssql = "select numero_expediente from expedientes where numero_expediente=1"; echo "<BR>" . $ssql . "<BR>"; if (odbc_error()) { echo odbc_errormsg($conn_access); } if($rs_access = odbc_exec ($conn_access, $ssql)){ echo "La sentencia se ejecuto correctamente"; $fila = odbc_fetch_row($rs_access,1); echo $fila; echo "<br>" . $fila->numero_expediente; }else{ //la sentencia no era correcta echo "Error al ejecutar la sentencia SQL"; } } else{ if (odbc_error()) { echo odbc_errormsg($conn_access); } echo "Error en la conexion con la base de datos"; } ?> but nothing appears in the screen, just blank.. any other suggestion? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-828327 Share on other sites More sharing options...
Axeia Posted May 7, 2009 Share Posted May 7, 2009 So what happened when you manually executed the query, nothing as well? Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-828809 Share on other sites More sharing options...
itetcboo Posted May 12, 2009 Author Share Posted May 12, 2009 it seems a problem with suhosin patch, I'm trying to disable it.... I'll continue reporting you Thanks so much. Quote Link to comment https://forums.phpfreaks.com/topic/148760-blank-results-when-adding-any-clause-to-sql-sentence-in-php-odbc-msaccess/#findComment-832316 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.