TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   i am new in mysql_db.....mysql web traffic db connect (http://www.talkphp.com/mysql-databases/4750-i-am-new-mysql_db-mysql-web-traffic-db-connect.html)

shaiful 07-18-2009 05:46 AM

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 );
    } 


Village Idiot 07-18-2009 04:18 PM

Take the @ away before the commands, that will allow commands to show their errors. Also, where is db_connect ever called?

codefreek 07-18-2009 05:30 PM

ModNote: Tags Added to first post,
Please read link that was provided for more information.


http://www.talkphp.com/lounge/4563-p...e-talkphp.html
-Cf

shaiful 07-19-2009 01:21 PM

db_connect called "localhost"


All times are GMT. The time now is 08:36 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0