(PHP) Help - What is wrong with this code - Please help
| From: | David Tandberg-Johansen | Date: | Fri, 28 Jul 2000 09:13:01 +0000 |
| Subject: | (PHP) Help - What is wrong with this code - Please help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8743@lists.php.net to get a copy of this message | ||
Hello All!
I have tried for over a week now , reading from the manual (www.php.net) an
been to php.faqts.com and I still don't know what i do wrong.
Could anyone give me a hint??
David
mk_hdl.php
*********************************************
<?PHP
$hostname = "localhost";
$username = "root";
$password = "";
$dbName = "database";
$name_first ="Name";
$name_sir ="Second_name";
function get_character ($name_first ,$name_sir)
{
$rest1 = substr ($name_first , 0, 1);
$rest2 = substr ($name_sir, 0, 1);
$rest3 = "$rest1$rest2";
$rest3;
}
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to
database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
function get_number ()
{
$result = mysql_db_query($dbName, "select count(*) as kundeid from
kunder");
$num = mysql_result($result,0,"kundeid");
$num;
}
function mk_hdl ()
{
get_character($fornavn,$etternavn);
get_number();
$hdl = "$rest3$num";
$hdl;
}
echo hdl();
?>
********************************