I'm having problems in listing the contents of my database.
Here's the error I get.
Error type: 2
Error description: mysql_query(): supplied argument is not a valid MySQL-Link resource
Error file: /include/dbconnection.php
Error line: 26
First 33 Lines of Code for dbconnection.php
PHP Code:
<?php
function db_connect()
{
global $host,$user,$pwd,$errstr,$sys_dbname,$port;
$strhost=$host;
if($port && $port!=3306)
$strhost=$strhost.":".$port;
$conn = mysql_connect ("localhost", "feud42c_james", "vallis") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("feud42c_mort");
if (!$conn|| !mysql_select_db($sys_dbname,$conn))
{
trigger_error(mysql_error(), E_USER_ERROR);
}
return $conn;
}
function db_close($conn)
{
return mysql_close($conn);
}
function db_query($qstring,$conn)
{
if(!($ret=mysql_query($qstring,$conn)))
{
trigger_error(mysql_error(), E_USER_ERROR);
}
return $ret;
Can anyone help ? Many thanks 
|