spearchilduser Posted March 25, 2012 Share Posted March 25, 2012 im getting a error i havent gotten since i started learnign php so i feel a bit stupid now btu its Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\students\08023190\dancomp\detailschange.php on line 19 the code its refering to is: 19 $query = "SELECT * FROM customer WHERE username = '$username'"; 20 echo $query; 21 $result1 = mysql_query($query); 22 $goo = $result; echo query just prints out the select statement and the $result prints out nothing The tables and attributes are spelt exaxctly as they are in the table and the database connection is ok as theres one connection in a include file and it works for every other page Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/ Share on other sites More sharing options...
trq Posted March 25, 2012 Share Posted March 25, 2012 Your connection is *not* fine. The error clearly states so. Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/#findComment-1330909 Share on other sites More sharing options...
spearchilduser Posted March 25, 2012 Author Share Posted March 25, 2012 but the connection is workign absolutely fine for every other page and its all using one include file so why would it be different for this page ? Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/#findComment-1330913 Share on other sites More sharing options...
mitramcc Posted March 25, 2012 Share Posted March 25, 2012 but the connection is workign absolutely fine for every other page and its all using one include file so why would it be different for this page ? The problem is connecting your DB so you must check if you don't close the connection in the process or something like that... Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/#findComment-1330917 Share on other sites More sharing options...
trq Posted March 25, 2012 Share Posted March 25, 2012 Are you sure the code that connects to the database is being included into the above problematic script? Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/#findComment-1330921 Share on other sites More sharing options...
PFMaBiSmAd Posted March 25, 2012 Share Posted March 25, 2012 Something tells me that your earlier 'white screen' thread and this one are for the same code and same problem, but this one differs in that you turned on error_reporting/display_errors so that you could see the error that was occurring at the msyql_query statement. Quote Link to comment https://forums.phpfreaks.com/topic/259678-error/#findComment-1330951 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.