mysql_query() expects parameter 2 to be resource
Scris: Sâm Mar 15, 2014
Salut,
config
function
Pe site imi arata urmatoarele erori:
si
Cum pot sa le rezolv?
config
Cod: Selectaţi tot
<?php
/*
* Database Connections
*/
$db_website = mysql_connect('localhost', 'root', 'pass', true) or die(mysql_error());
$db_server = mysql_connect('localhost', 'roor', 'pass', true) or die(mysql_error());
mysql_select_db('website', $db_website) or die(mysql_error());
mysql_select_db('server', $db_server) or die(mysql_error());
?>
Cod: Selectaţi tot
function getSettings()
{
$result = mysql_query("SELECT * FROM `settings`", $db_website); // Linia 7
while ($myrow = mysql_fetch_array($result)) // Linia 8
{
global $contact_email, $ntfm, $title, $keywords, $description, $copyright, $url, $theme, $atheme;
$contact_email = $myrow['contact_email'];
$ntfm = $myrow['ntfm'];
$title = $myrow['title'];
$keywords = $myrow['keywords'];
$description = $myrow['description'];
$copyright = $myrow['copyright'];
$url = $myrow['url'];
$theme = $myrow['theme'];
$atheme = $myrow['atheme'];
}
}
Cod: Selectaţi tot
Warning: mysql_query() expects parameter 2 to be resource, string given in E:\webpages\includes\functions.php on line 7
Cod: Selectaţi tot
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in E:\webpages\includes\functions.php on line 8