MySQL query not working in PHP and I believe all of the code to be correct -
This code is a file that, for some reason, the selected query will not run in my database already there is an input , So it should return something
& lt ;? Connect to Php // database DEFINE ('DB_HOST', 'localhost'); Define ('DB_USER', 'Ericbran'); Define ('db_password', '[password]'); DEFINE ('DB_NAME', 'Ericbran_family Function'); $ Dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD) or die (can not 'connect to MySQL'); Mysqli_select_db (DB_NAME, $ dbc); $ Printable = "select * from users"; $ Result = mysqli_query ($ printable, $ dbc) or die (mysqli_error ()); While ($ line = mysqli_fetch_assoc ($ result)) {foreach ($ name as $ name = & gt; $ value) {print "$ name: $ value
$ results = mysqli_query ($ printable, $ dbc) should be
$ result = mysqli_query ($ dbc, $ printable) ) When using the mysqli _ * function, the DB connection comes first.
Comments
Post a Comment