Search the Community
Showing results for tags 'connecting to database'.
-
Hello My instructor routinely gives assignments where the code doesn't work and we have to fend for ourselves to figure out what the issue is. My assignment is to enter this code and connect to Acquia Drupal database. i keep getting an error referring to link 1 where the database connect statement is given. The database doesn't have a password. I did enter the code in Phpmy admin before I tried to upload it to the Acqui-Drupal desktop to find the error in line one. This is the code. He doesn't use the same syntax as the book which makes learning harder. Any idea what is wrong with the database connect statement? I did try adding my user name and password in the connect mysqli_connect statement but it did not help. <?PHP //book page 268 $dbc=mysqli_connect("localhost","root",""); mysqli_select_db($dbc,"acquia_drupal"); $query="select name from role"; $r=mysqli_query($dbc,$query); while($row=mysqli_fetch_array($r)) { echo $row['name']."<br />"; } mysqli_close($dbc); ?>
-
Hi there - the most hated problem has occurred (for amateurs at least) can't connect to database message An error occurred in script '/hermes/waloraweb004/b1384/moo.laissezfairelondonco/wolfcut.co.uk/views/home.html' on line 14: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given index.php line 14 // Require the database connection: require ('../mysql.inc.php'); folder structure mysql.inc.php (outside web root) beans (folder) --------- > index.php (with the error message) --------- > billing.php --------- > browse.php --------- > etc...