query, include, echo...

wxdqz

New Member
Below is the main.php file I am trying to get to work, I am unfortunately a novice jumping in the deep end because I have no choice ;) any help would be much appreciated as I've spent half a day fiddling with this... all it gives is a blank page and no results from the database.


<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php

$hostname = "localhost";
$usernamedb = "jonkane";
$passworddb = "password";
$dbName = "informotion";

$db = MYSQL_CONNECT($hostname, $usernamedb, $passworddb);
@mysql_select_db("$dbName");

$result = mysql_query("SELECT * FROM clientDetails WHERE clientName='Madfish'",$db);

?>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<? include("db.include"); ?>
</body>

__________________________________________
It may seem strange to be trying to put the echo in an include page but I am trying to set up a template that lots of other .php files will read, displaying certain variables depending on what client .php page it is (hence the WHERE clientName='Madfish'). Hope this all makes sense to someone :)

The include file db.include has only this so far:

<?php echo $result; ?>
 
Back
Top