1

Topic: The request does not work at tables

There is a request, on a site joomla by means of the unit to obtain the data with Mysql, all works normally, but it is necessary to change the data for other table, at once ceases to work with an error
Here request

<? php
$sdd_db_host ='localhost ';//your host
$sdd_db_name = ' * ';//yours 
$sdd_db_user = ' * ';//the user 
$sdd_db_pass = ' * ';//the password to 
$conn = mysql_connect ($sdd_db_host, $sdd_db_user, $sdd_db_pass);//a connection with the server 
mysql_query ("SET NAMES ' utf8 '");
mysql_query ("SET CHARACTER SET ' utf8 '");
mysql_query ("SET SESSION collation_connection = ' utf8_general_ci '");
if (! $conn)
{
throw new Exception (' it was not possible to be connected to a database! Check up connection parameters ');
}
if (! mysql_select_db ($sdd_db_name, $conn))//a choice 
{
throw new Exception ("it was not possible to select a database {$ssd_db_name}!");
}
$strSQL = "SELECT zatrata, region, cyti, tipotdeleniya FROM ldo56_zayavki_upakovka WHERE mb3 ='P10310000X '";
$rs = mysql_query ($strSQL);
while ($row = mysql_fetch_array ($rs)) {
//to Write down value of column FirstName (which is now an array $row)
echo $row [' region ']. "". $row [' cyti ']."
";
}
//to Close connection with a DB
mysql_close ();
?>

It is necessary to change and at once error Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in

<? php
$sdd_db_host ='localhost ';//your host
$sdd_db_name = ' * ';//yours 
$sdd_db_user = ' * ';//the user 
$sdd_db_pass = ' * ';//the password to 
$conn = mysql_connect ($sdd_db_host, $sdd_db_user, $sdd_db_pass);//a connection with the server 
mysql_query ("SET NAMES ' utf8 '");
mysql_query ("SET CHARACTER SET ' utf8 '");
mysql_query ("SET SESSION collation_connection = ' utf8_general_ci '");
if (! $conn)
{
throw new Exception (' it was not possible to be connected to a database! Check up connection parameters ');
}
if (! mysql_select_db ($sdd_db_name, $conn))//a choice 
{
throw new Exception ("it was not possible to select a database {$ssd_db_name}!");
}
$strSQL = "SELECT zatrata, region, cyti, tipotdeleniya FROM ldo56_zayavki_dostavki WHERE mb3out ='P10310000X '";
$rs = mysql_query ($strSQL);
while ($row = mysql_fetch_array ($rs)) {
//to Write down value of column FirstName (which is now an array $row)
echo $row [' region ']. "". $row [' cyti ']."
";
}
//to Close connection with a DB
mysql_close ();
?>

2

Re: The request does not work at tables

kot488 wrote:

Here request

It - not request! It is a PHP-code.

kot488 wrote:

it is necessary to change and at once error Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in

And an error - in a PHP-code.

kot488 wrote:

it is necessary to change

the Only thing that changed - a table name from which the data is requested.
I assume that its structure does not correspond to request, and notorious boolean is an error status code.