$DB = "dbproj1"; $HOST = "localhost"; $USRNAME = "dbs"; $PSSWD = "*********"; //Normally the actual password would appear here (not stars). //Use a @ before the function name to suppress the automatic error // message so you can use your own. if( !@mysql_connect($HOST, $USRNAME, $PSSWD) ) { print "Error connecting to $DB"; exit(0); } else { $sqlstr = "SELECT * FROM vendor;" ; $result = mysql_db_query($DB, $sqlstr); if ( $result == 0 ) { print "Invalid Query"; } //----------------------------------------------------------------------?>