I didn't understand this code that you posted:
<?php
// in config.php I define the host, user, pw and database
include_once("config.php");
mysql_connect($db_host,$db_user,$db_passwd);
mysql_select_db($db_database);
function db_execute ($query) {
$result = mysql_query($query);
//this is not necessary
if(mysql_errno()!=0) die(mysql_error());
return $result;
}
?>
The reason I ask is, I always use code like this :
$db_name = "testdb";
$conn = mysql_connect("localhost", $user, $pword) or die ("Couldn't connect.");
$db = mysql_select_db($db_name, $conn) or die ("Couldn't select local database -- $db_name");
So where is your "connection" parameter in your code when you do the select? How can that work without one?
Just curious.