Pls help:

Warning: require(connect_to_mysql.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\chibenda\root_directory\index.php on line 3

<?php  

$db_host = "localhost"; 
// Place the username for the MySQL database here 
$db_username = "root";  
// Place the password for the MySQL database here 
$db_pass = "";  
// Place the name for the MySQL database here 
$db_name = "chibenda"; 

// Run the connection here  
mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); 
mysql_select_db("$db_name") or die ("no database");              
?>

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

<?php
session_start();
require "connect_to_mysql.php";

// Build Main Navigation menu and gather page data here
$sqlCommand="SELECT id,linklabel FROM pages ORDER BY pageorder ASC";
$query=mysqli_query($myConnection,$sqlCommand)or die(mysqli_error());

$menuDisplay='';
while($row=mysqli_fetch_array($query)){
	$pid=$row["id"];
	$linklabel=$row["linklabel"];

	$menuDisplay='<a href="index.php?pid='  . $id . '">Home</a><br/>';

}
mysqli_free_result($query);
//mysqli_close_result($query);
?>

REQUIRE "connect_to_mysql.php";
means you must have a file of that name, which will then contain your connection details.

So, is the opening bit of PHP code you give saved in a file called connect_to_mysql.php and in the same folder as the other file that uses it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.