Я получаю ошибку ниже. У меня есть копия вставить код. Я очень мало знаю PHP, пожалуйста, наставляйте меня.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/test_bader/public_html/include/connect.php on line 66
<?php
$DBHOST = "localhost";
$DBUSER = "tese_test";
$DBPASS = "";
$DB = "test_bader";
$default_dbname="test_bader";
*/
$DBHOST = "localhost";$
$Port= "3306";
$DBUSER = "test_test";
$DBPASS = "test@.";
$DB = "test_bader";
$default_dbname="test_bader";$con=mysql_connect($DBHOST,$DBUSER,$DBPASS) or die(mysql_error());
mysql_select_db($DB);
function db_connect()
{
global $DBHOST, $DBUSER, $DBPASS, $default_dbname, $DB , $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect("$DBHOST","$DBUSER","$DBPASS");
if (!$link_id)
{
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection Fail to the host $DBHOST.";
}
else if(empty($DB ) && !mysql_select_db($default_dbname))
{
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else if(!empty($DB ) && !mysql_select_db($DB ))
{
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link_id;
}function sql_error()
{
global $MYSQL_ERRNO, $MYSQL_ERROR;
if(empty($MYSQL_ERROR))
{
$MYSQL_ERRNO = mysql_erron();
$MYSQL_ERROR = mysql_error();
}
return "$MYSQL_ERRNO : $MYSQL_ERROR";
}
function q($st)
{
$r=mysql_query($st);
return $r;
}
function f($st)
{
$r=mysql_fetch_array($st);
return $r;
}
?>
<?php
$DBHOST = "localhost";
$DBUSER = "tese_test";
$DBPASS = "";
$DB = "test_bader";
$default_dbname="test_bader";
*/
$DBHOST = "localhost";$
$Port= "3306";
$DBUSER = "test_test";
$DBPASS = "test@.";
$DB = "test_bader";
$default_dbname="test_bader";$con=mysql_connect($DBHOST,$DBUSER,$DBPASS) or die(mysql_error());
mysql_select_db($DB);
function db_connect()
{
global $DBHOST, $DBUSER, $DBPASS, $default_dbname, $DB , $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect("$DBHOST","$DBUSER","$DBPASS");
if (!$link_id)
{
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection Fail to the host $DBHOST.";
}
else if(empty($DB ) && !mysql_select_db($default_dbname))
{
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else if(!empty($DB ) && !mysql_select_db($DB ))
{
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link_id;
}function sql_error()
{
global $MYSQL_ERRNO, $MYSQL_ERROR;
if(empty($MYSQL_ERROR))
{
$MYSQL_ERRNO = mysql_erron();
$MYSQL_ERROR = mysql_error();
}
return "$MYSQL_ERRNO : $MYSQL_ERROR";
}
function q($st)
{
$r=mysql_query($st);
return $r;
}
function f($st)
{
$r=mysql_fetch_array($st);
return $r;
}
?>
Других решений пока нет …