TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-18-2009, 05:46 AM   #1 (permalink)
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
Old 07-18-2009, 04:18 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

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

Village Idiot is offline  
Reply With Quote
Old 07-18-2009, 05:30 PM   #3 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

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


Prettifying Pasted Code on TalkPHP
-Cf
codefreek is offline  
Reply With Quote
Old 07-19-2009, 01:21 PM   #4 (permalink)
The Wanderer
 
Join Date: May 2009
Posts: 6
Thanks: 0
shaiful is on a distinguished road
Default

db_connect called "localhost"
shaiful is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Server error #2003(HY000): Can't connect to MySQL Server on 'localhost'(10061) Yoosha MySQL & Databases 3 06-15-2009 02:45 PM
MySQL Sell Up Alan @ CIT The Lounge 12 01-17-2008 05:46 PM
Error in connecting to MySQL via PHP EyeDentify MySQL & Databases 0 01-03-2008 01:06 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM
A nice way to use a MySQL class Gibou Advanced PHP Programming 0 11-27-2007 11:42 PM


All times are GMT. The time now is 07:06 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design