View Single Post
Old 07-18-2009, 05:46 AM   #1 (permalink)
shaiful
The Wanderer
 
Join Date: May 2009
Posts: 6
Thanks: 0
shaiful is on a distinguished road
Default i am new in mysql_db.....mysql web traffic db connect

i create web traffic status in my website,
but that command i put can do connect to db, anyone can help
i think what wrong is that command

PHP Code:
<?php

$db     
"aneka_db";     <---db name
$tabel  
$db .".";
$tabel .= "traffic";      <---databese table name

$con 
= @mysql_connect ("localhost","","");
if (!
$con) {
    echo 
"<p>Tidak dapat melakukan Sambungan</p>";
    exit();
}
?>
---------------------------------------------------------

my database function dbConnect

----------------------------------------------------------
PHP Code:
function dbConnect()
    {
        global 
$dbHost$dbUser$dbPasswd$dbName;
        
mysql_connect$dbHost$dbUser$dbPasswd ) or errormysql_error() );
        
mysql_select_db$dbName );
    } 

Last edited by codefreek : 07-18-2009 at 05:29 PM. Reason: tags added - please read http://www.talkphp.com/lounge/4563-prettifying-pasted-code-talkphp.html
shaiful is offline  
Reply With Quote