jack7076 Posted January 14, 2016 Share Posted January 14, 2016 (edited) Here in the attached file shows that my users are not showing but activation and deactivation is showing. Please help Thanks in advance -- Jack SRC CODE: I have defined a Conection to my DB @mysql_connect("URL to DB","My user","MY PASS","DB") or die("Failed to connect to MySQL: " . mysql_error()); //List Usersmysql_select_db("a4823842_1");$list_query = mysql_query("SELECT * FROM username");while($Users = mysql_fetch_array($list_query)){ $u_username = $Users['username']; $u_type = $Users['type'];?><tr><td class='listuseradmin'><?php echo $Users['username']; ?></td><td><?php if($u_type == 'a'){ echo '<a href="">Deactivate</a>';}else{ echo '<a href="">Activate</a>';}}}?></td></tr></table> Edited January 14, 2016 by jack7076 Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted January 14, 2016 Share Posted January 14, 2016 is your database column spelled and capitalized exactly as username ? Quote Link to comment Share on other sites More sharing options...
jack7076 Posted January 14, 2016 Author Share Posted January 14, 2016 yes it is Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted January 14, 2016 Share Posted January 14, 2016 then the most likely cause would be empty data in that column or data that looks like a html tag (has < > around it) so that it doesn't display anything. are you sure you have data in that column? could you have executed a query that cleared all the user names/set them to empty strings? what does the 'view source' of the output in your browser show? Quote Link to comment Share on other sites More sharing options...
Solution jack7076 Posted January 14, 2016 Author Solution Share Posted January 14, 2016 Fixed $Users['username'] incorrect corection $Users['userName'] Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted January 14, 2016 Share Posted January 14, 2016 yes it is so, that was a lie. someone took the time to ask you if the spelling and capitalization matched the column name. they didn't do that because they needed practice typing. that was asked because the spelling and capitalization must be correct for your code to work. Quote Link to comment 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.