I connect the database to the site, but throws an error.
Warning: mysql_fetch_array () expects parameter 1 to be resource, given in C: \ OpenServer \ domains \ ProbaSite \ index.php on line 4
Error screenshot:
I would like to make a reservation in advance what I did for the lesson (it may be old and I will not be able to provide links to it because they threw files at me), PHPMyAdmin was used there, but I want to connect via SQL Maestro. I do everything through the Open Server.
Code file index.php
<?php include ("blocks/bd.php"); $result=mysql_query("SELECT title,meta_d,meta_k,text FROM settings WHERE page='index'",$db); $myrow = mysql_fetch_array($result); ?> <!DOCTYPE html> <html> <html> <head> <meta name="description" content="<?php echo $myrow['meta_d']; ?>"> <meta name="keywords" content="<?php echo $myrow['meta_k']; ?>"> <meta charset="windows-1251"> <title><?php echo $myrow['title']; ?></title> <link rel="stylesheet" href="style.css"> </head> <body> <table width="700" border="0" align="center" cellpadding="0" sellspacing="0" bgcolor="#FFFFFF" class="main_border"> <? include ("blocks/header.php"); ?> <tr> <td><table width="700" border="0" cellpadding="0" sellspacing="0"> <tr> <?include ("blocks/left.php"); ?> <td valign="top"> <?php echo $myrow['text']; ?> </td> </tr> </table></td> </tr> <? include ("blocks/footer.php"); ?> </table> </body> </html> Bd.php file code
<?php $db=mysql_connect ("localhost","root"); mysql_select_db ("MyWork",$db); ?> 