hello,
ive got a script whith a lot of functions. In every function i make a connection to a database.
I had made a function that connects to a database and send the information back..
It isnt working.. can you tell me why?
here's my code. (atleast, how it works. You can few the full code at http://www.teye.nl/data.txt)
Thanx
Teye
btw: i get this errors:
Warning: odbc_fetch_row(): 3 is not a valid ODBC result resource in c:\program files\apache group\apache\htdocs\helpdesk\data.php on line 69
Warning: odbc_fetch_row(): 10 is not a valid ODBC result resource in c:\program files\apache group\apache\htdocs\helpdesk\data.php on line 129
Warning: First argument to array_keys() should be an array in c:\program files\apache group\apache\htdocs\helpdesk\userinfo.php on line 29
<?
function ConnectMYSQL ($query) {
/ maak mysql connectie met de volgende gegevens (database, host, gebruiker, pass) /
$mysql_connect = mysql_pconnect("localhost", "", "");
$connect = mysql_select_db("personalia", $mysql_connect);
/* voer de query uit */
$sql = mysql_query($query) or die(mysql_error() . "\n" . $query);
/* sluit de databaseconnectie */
mysql_close($mysql_connect);
/* return de gegevens */
return $sql;
}
function ListSecties() {
/ de query die uitgevoerd wordt /
$query = "SELECT * FROM afdeling ORDER BY afd_id";
/* voer de query uit */
$sql = ConnectMYSQL($query);
/* stop de resultaten in een array */
$secties=array();
while($row = mysql_fetch_object($sql)) {
$secties[$row->afd_id] = $row->afd_naam;
}
/* geef de array terug */
return $secties;
}
?>