function calling

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mlhazan
Forum Newbie
Posts: 3
Joined: Tue Feb 16, 2010 4:15 pm

function calling

Post by mlhazan »

hello experts,
i created a file name "loginFunction.php" :

Code: Select all

 
function login()
    {
    $host="localhost";
    $user="root";
    $pass="";
    $connect=mysql_connect($host,$user,$pass)or
    die ("ERROR:REQUEST DENIED");
    exit(1);
    $dbname="wileyF";
mysql_query("CREATE DATABASE $dbname") or die("Couldn't Create Database: $dbname");  
    
    }
?>
 
Then I created a file to connect the database, connect.php:

Code: Select all

 
<?php
include "loginFunction.php";
login();
 
?>
 
I opened a browser and typed:
http://localhost/practice/connect.php
The problem is I don't see any effect on phpmyadmin.The code even shows no error at all.
My server is running just fine.Cause I have tested.
Can anyone here to help me.
Sincerely,
ml
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: function calling

Post by requinix »

Code: Select all

exit(1);
exit() terminates the script.
mlhazan
Forum Newbie
Posts: 3
Joined: Tue Feb 16, 2010 4:15 pm

[SOLVED]function calling

Post by mlhazan »

Solved.Thanks a lot.
Post Reply